:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --success-hover: #16a34a;
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --surface-lighter: #404040;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: #404040;
    --input-bg: #333333;
    --input-border: #404040;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.manager-container {
    display: none;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 0 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn i {
    font-size: 0.9em;
}

.btn-primary {
    background: var(--primary);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: var(--text);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: var(--text);
}

.btn-success:hover {
    background: var(--success-hover);
}

.streams-container {
    display: grid;
    gap: 20px;
}

.stream-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.stream-header h3 {
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    color: var(--text);
    font-size: 1.2em;
}

.stream-header h3::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 10px;
    transition: transform 0.3s;
}

.stream-card.expanded .stream-header h3::after {
    transform: rotate(180deg);
}

.stream-content {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stream-card.expanded .stream-content {
    display: grid;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.playlist-container {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--input-bg);
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.playlist-item:last-child {
    border-bottom: none;
}

.audio-player {
    width: 100%;
    margin: 10px 0;
    border-radius: 4px;
    background: var(--input-bg);
}

.btn-icon {
    padding: 5px;
    font-size: 16px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--primary);
    transition: color 0.3s;
}

.btn-icon:hover {
    opacity: 0.8;
}

.btn-icon.delete {
    color: var(--danger);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--surface);
    margin: 5% auto; /* Changé de 15% à 5% pour le remonter */
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    color: var(--text);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--text);
    text-decoration: none;
}

#configOutput {
    background: var(--input-bg);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: var(--text);
    font-family: monospace;
}
.header-center {
    display: flex;
    gap: 10px;
}

.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading i {
    visibility: hidden;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.stream-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stream-header h3 span {
    cursor: pointer;
}

.stream-link {
    color: var(--primary);
    font-size: 0.8em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.stream-link:hover {
    color: var(--primary-hover);
}

/* Empêcher le comportement par défaut de la flèche */
.stream-header h3::after {
    display: none;
}

.stats-container {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
}

.stat-value {
    color: var(--text);
    font-size: 1.2em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
