/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary-color: #9147ff;
    --primary-hover: #772ce8;
    --primary-light: #bf94ff;
    --secondary-color: #00d9ff;
    --danger-color: #ff6b6b;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    
    --bg-primary: #0e0e10;
    --bg-secondary: #18181b;
    --bg-tertiary: #1f1f23;
    --bg-card: #18181b;
    --bg-input: #26262c;
    --bg-hover: #2a2a2d;
    
    --text-primary: #efeff1;
    --text-secondary: #adadb8;
    --text-muted: #6e6e73;
    
    --border-color: #2d2d2f;
    --border-light: #3a3a3d;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(145, 71, 255, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0e0e10 0%, #18181b 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.app-title i {
    color: var(--primary-color);
    font-size: 28px;
}

.audio-mute-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mute-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.mute-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.18), rgba(0, 217, 255, 0.08));
    opacity: 0;
    transition: var(--transition);
}

.mute-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.mute-toggle:hover::before {
    opacity: 1;
}

.mute-toggle:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.mute-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 13px;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.mute-toggle__label {
    position: relative;
    z-index: 1;
}

/* Actif = son audible */
.mute-toggle.is-active {
    color: var(--text-primary);
    border-color: rgba(145, 71, 255, 0.45);
    box-shadow: 0 0 12px rgba(145, 71, 255, 0.2);
}

.mute-toggle.is-active::before {
    opacity: 1;
}

.mute-toggle.is-active .mute-toggle__icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    box-shadow: 0 2px 8px rgba(145, 71, 255, 0.45);
}

/* Coupé */
.mute-toggle.is-muted {
    color: var(--text-muted);
    border-color: rgba(255, 107, 107, 0.35);
    background: rgba(255, 107, 107, 0.06);
}

.mute-toggle.is-muted .mute-toggle__icon {
    background: rgba(255, 107, 107, 0.12);
    color: var(--danger-color);
}

.mute-toggle.is-muted .mute-toggle__icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 18px;
    background: var(--danger-color);
    border-radius: 1px;
    transform: translate(-50%, -50%) rotate(-45deg);
    box-shadow: 0 0 4px rgba(255, 107, 107, 0.5);
    pointer-events: none;
}

.mute-toggle.is-muted .mute-toggle__icon {
    position: relative;
}

/* ============================================
   TABS
   ============================================ */
.tabs-container {
    margin-bottom: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-md);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.tab-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: var(--shadow-glow);
}

.tab-button.active::before {
    width: 100%;
}

.tab-button i {
    font-size: 16px;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.card-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.card-description {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 14px;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================
   STREAM INFO
   ============================================ */
.stream-info-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.stream-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.stream-info-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stream-info-field label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stream-info-field label i {
    color: var(--primary-color);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stream-info-field input {
    flex: 1;
    min-width: 250px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.stream-info-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   MESSAGES
   ============================================ */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

.message {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.message-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.username {
    font-weight: 600;
    color: var(--primary-light);
    margin-right: 8px;
    font-size: 14px;
}

.message-text {
    color: var(--text-primary);
    font-size: 14px;
    word-wrap: break-word;
}

.timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.tts-message {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 13px;
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--secondary-color);
}

.play-button,
.no-audio {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.play-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.no-audio {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.5;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
}

.form-select {
    cursor: pointer;
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-glow);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.volume-value {
    color: var(--primary-light);
    font-weight: 600;
    margin-left: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.replacements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.replacement-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.replacement-item input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.replacement-item input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   VOICE CONFIGS
   ============================================ */
.configs-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    margin-bottom: 24px;
}

.configs-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.configs-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.voice-configs-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.voice-config {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.voice-config:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.voice-config-field {
    margin-bottom: 16px;
}

.voice-config-field:last-child {
    margin-bottom: 0;
}

.voice-config-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.voice-config-field input[type="text"],
.voice-config-field input[type="number"],
.voice-config-field select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.voice-config-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.model-select-container,
.language-select-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   SIMULATION FORM
   ============================================ */
.simulation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   ALERT SOUNDS
   ============================================ */
.alert-sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.alert-sound-card {
    border: 1px solid var(--border-color);
}

.alert-sound-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-hover);
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.alert-sound-details {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-top: 12px;
}

.sub-tier-sound-block {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

.sub-tier-sound-block:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.sub-tier-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

/* Barre de sauvegarde collante (onglet sons d'alertes) */
.alert-sounds-save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 50;
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
}

.file-upload-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input {
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.current-file {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
}

/* ============================================
   AUDIO FILE DISPLAY (Simplifié)
   ============================================ */
.audio-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.audio-file-row.has-file {
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.15) 0%, rgba(0, 217, 255, 0.05) 100%);
    border-color: var(--primary-color);
}

.audio-icon {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.audio-file-row.has-file .audio-icon {
    color: var(--primary-color);
}

.audio-file-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-file-row.has-file .audio-file-name {
    color: var(--text-primary);
    font-weight: 500;
}

.audio-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-play {
    background: var(--success-color);
    color: white;
}

.btn-play:hover {
    background: #22c55e;
    transform: scale(1.05);
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.btn-upload {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    overflow: hidden;
}

.btn-upload:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
    background: var(--bg-hover);
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* File selector group */
.file-selector-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.file-selector {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.file-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
}

.file-selector option {
    background: var(--bg-input);
    color: var(--text-primary);
}

.file-upload-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
    position: relative;
}

.file-upload-separator::before,
.file-upload-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.file-upload-separator span {
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Volume group amélioré */
.volume-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.volume-group label i {
    color: var(--primary-color);
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.volume-slider-container .form-range {
    flex: 1;
}

.volume-slider-container .volume-value {
    min-width: 45px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-light);
    background: var(--bg-input);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.thresholds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.threshold-item {
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.threshold-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.threshold-range {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.threshold-range .form-input {
    width: 80px;
    padding: 8px 10px;
    text-align: center;
    font-size: 14px;
}

.threshold-separator {
    color: var(--text-muted);
    font-size: 16px;
}

.threshold-audio-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.threshold-audio-row.has-file {
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.15) 0%, rgba(0, 217, 255, 0.05) 100%);
    border-color: var(--primary-color);
}

.threshold-audio-row .audio-icon {
    font-size: 16px;
    color: var(--text-muted);
}

.threshold-audio-row.has-file .audio-icon {
    color: var(--primary-color);
}

.threshold-file-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.threshold-audio-row.has-file .threshold-file-name {
    color: var(--text-primary);
    font-weight: 500;
}

.threshold-volume-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threshold-volume-row > i {
    color: var(--text-muted);
    font-size: 14px;
}

.threshold-volume-row .form-range {
    flex: 1;
}

.threshold-volume-value {
    min-width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}

/* ============================================
   HELP CONTENT
   ============================================ */
.help-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.help-content p {
    margin-bottom: 12px;
}

.help-content strong {
    color: var(--text-primary);
}

.tags-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.tags-examples code {
    background: var(--bg-input);
    color: var(--primary-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.help-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(145, 71, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.help-note i {
    color: var(--primary-color);
}

/* ============================================
   V3 CONTROLS
   ============================================ */
.stability-v3-controls,
.style-v3-controls {
    margin-top: 12px;
}

.stability-buttons,
.style-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stability-btn,
.style-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.stability-btn:hover,
.style-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.stability-btn.active,
.style-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.v3-warning {
    display: none;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: 8px;
    color: var(--danger-color);
    font-size: 12px;
}

.stability-container,
.style-container,
.similarity-container {
    position: relative;
}

.stability-help,
.style-help {
    display: none;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
    font-style: italic;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.messages-container::-webkit-scrollbar,
#messageHistory::-webkit-scrollbar,
#archiveHistory::-webkit-scrollbar {
    width: 10px;
}

.messages-container::-webkit-scrollbar-track,
#messageHistory::-webkit-scrollbar-track,
#archiveHistory::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 5px;
}

.messages-container::-webkit-scrollbar-thumb,
#messageHistory::-webkit-scrollbar-thumb,
#archiveHistory::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

.messages-container::-webkit-scrollbar-thumb:hover,
#messageHistory::-webkit-scrollbar-thumb:hover,
#archiveHistory::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ============================================
   AUDIO TAGS HELP
   ============================================ */
#audioTagsHelp {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .configs-layout {
        grid-template-columns: 1fr;
    }
    
    .configs-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .header-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .app-title {
        font-size: 24px;
    }

    .audio-mute-controls {
        width: 100%;
        justify-content: center;
    }

    .mute-toggle {
        flex: 1;
        justify-content: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        justify-content: center;
    }
    
    .stream-info-grid,
    .filters-grid,
    .alert-sounds-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .stream-info-field input {
        width: 100%;
        min-width: unset;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.small {
    font-size: 12px;
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Commandes chat */
.commands-intro {
    margin-bottom: 1rem;
}

.commands-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.75rem 0 1rem;
}

.commands-hint code {
    font-size: 0.85em;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.06));
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.commands-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.commands-empty {
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

.command-row {
    padding: 1rem 1.25rem;
}

.command-row__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.command-row__enabled {
    margin: 0;
}

.command-roles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.command-roles__label {
    font-weight: 500;
    margin-right: 0.25rem;
}

.commands-global-cooldown {
    max-width: 12rem;
}
