@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Playfair+Display:wght@700&family=Oswald:wght@400;500;700&display=swap');

:root {
    --primary-color: #4a90e2;
    --accent-color: #357abd;
    --bg-color-1: #ffffff;       /* Fond blanc */
    --bg-color-2: #f8fafc;       /* Très léger gris/bleu pour le dégradé */
    --bg-color: #fdfaf5;
    --surface-color: rgba(255, 255, 255, 0.9);
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #636e72;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Header Noir Léger pour thèmes colorés */
body.theme-vert header,
body.theme-orange header,
body.theme-violet header {
    background: rgba(15, 15, 15, 0.8) !important;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.theme-vert .theme-btn,
body.theme-orange .theme-btn,
body.theme-violet .theme-btn {
    background: rgba(40, 40, 40, 0.8);
    border-color: var(--primary-color);
    color: #fff;
}

/* Theme Overrides (Identical to accueil.css for consistency) */
body.theme-rouge {
    --primary-color: #e74c3c;
    --accent-color: #c0392b;
    --bg-color-1: #fee2e2;
    --bg-color-2: #fecaca;
}

body.theme-vert {
    --primary-color: #27ae60;
    --accent-color: #219150;
    --bg-color-1: #d1fae5;
    --bg-color-2: #a7f3d0;
}

body.theme-violet {
    --primary-color: #8e44ad;
    --accent-color: #7d3c98;
    --bg-color-1: #f3e8ff;
    --bg-color-2: #e9d5ff;
}

body.theme-orange {
    --primary-color: #ff9f43;
    --accent-color: #f39c12;
    --bg-color-1: #fff3e0;
    --bg-color-2: #ffe0b2;
}

body.theme-nuit {
    --primary-color: #7eb8f7;
    --accent-color: #5a9fd4;
    --bg-color-1: #0d1117;
    --bg-color-2: #161b22;
    --bg-color: #0d1117;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-light: #8b949e;
    --surface-color: rgba(22, 27, 34, 0.95);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* === DARK MODE OVERRIDES (lieu) === */

/* Header */
body.theme-nuit header {
    background: #161b22;
    border-bottom: 2px solid #30363d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Story Title */
body.theme-nuit .story-title {
    color: var(--primary-color);
}

/* Carousel */
body.theme-nuit .slide {
    background-color: #21262d;
}

/* Audio Player */
body.theme-nuit .audio-player {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.theme-nuit .progress-bar-container { background: #30363d; }
body.theme-nuit .volume-slider-visual { background: #30363d; }

body.theme-nuit .control-btn.outline-btn {
    border-color: #30363d;
    background: transparent;
    color: var(--primary-color);
}

body.theme-nuit .control-btn.outline-btn:hover {
    border-color: var(--primary-color);
    background: rgba(126, 184, 247, 0.1);
}

body.theme-nuit .time-display { color: #8b949e; }

/* Transcription */
body.theme-nuit .transcription-section {
    background: #161b22;
    border: 1px solid #30363d;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.theme-nuit .transcription-header {
    background: #161b22;
    border-bottom-color: #30363d;
}

body.theme-nuit .transcription-header h3 { color: var(--primary-color); }
body.theme-nuit .transcription-section.open .transcription-header { border-bottom-color: #30363d; }
body.theme-nuit .text-body { color: #c9d1d9; }

/* Auth button */
body.theme-nuit .auth-btn {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
}

body.theme-nuit .auth-btn:hover {
    background: var(--primary-color);
    color: #0d1117;
    border-color: var(--primary-color);
}

/* Modal */
body.theme-nuit .modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    color: #e6edf3;
}

body.theme-nuit .modal-content h2 { color: #e6edf3; }
body.theme-nuit .close-modal { color: #8b949e; }
body.theme-nuit .form-group input { background: #0d1117; border-color: #30363d; color: #e6edf3; }

/* Footer */
body.theme-nuit footer {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-top-color: #30363d;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    color: #8b949e;
}


body.theme-abeille {
    --primary-color: #f1c40f;
    --accent-color: #d4ac0d;
    --bg-color-1: #1a1a2e;
    --bg-color-2: #2c3e50;
    --text-primary: #fef9e7;
    --text-secondary: #f0d060;
    --text-light: #c8b560;
    --surface-color: rgba(28, 28, 28, 0.92);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Header abeille */
body.theme-abeille header {
    background: #1a1a1a;
    border-bottom: 3px solid #f1c40f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
}

body.theme-abeille .header-left { 
    order: 2; 
    justify-content: center; /* Centrage Logo Lycée */
}
body.theme-abeille .header-center { 
    order: 1; 
    justify-content: flex-start; 
}
body.theme-abeille .header-right { 
    order: 3; 
}


/* Bouton S'authentifier */
body.theme-abeille .auth-btn {
    background: #1a1a1a;
    color: #f1c40f;
    border: 2px solid #f1c40f;
    font-weight: 700;
}

body.theme-abeille .auth-btn:hover {
    background: #f1c40f;
    color: #1a1a1a;
    border-color: #f1c40f;
}

/* Story title */
body.theme-abeille .story-title {
    color: #f1c40f;
    font-family: 'Oswald', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 2px 20px rgba(241, 196, 15, 0.3);
}

/* Slide placeholder */
body.theme-abeille .slide {
    background-color: #1a1a1a;
}

/* Carousel hexagonal pour Abeille */
body.theme-abeille .carousel-container {
    clip-path: polygon(5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%, 0% 50%);
    border: none;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.2);
}


/* Audio Player */
body.theme-abeille .audio-player {
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(241, 196, 15, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.theme-abeille .progress-bar-container {
    background: #2c2c2c;
}

body.theme-abeille .volume-slider-visual {
    background: #2c2c2c;
}

body.theme-abeille .control-btn.outline-btn {
    border-color: rgba(241, 196, 15, 0.4);
    background: transparent;
    color: #f1c40f;
}

body.theme-abeille .control-btn.outline-btn:hover {
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

body.theme-abeille .play-pause-btn {
    background: #f1c40f;
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
}

body.theme-abeille .time-display {
    color: #c8b560;
}

/* Transcription */
body.theme-abeille .transcription-section {
    background: #1a1a1a;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

body.theme-abeille .transcription-header {
    background: #1a1a1a;
    border-bottom-color: rgba(241, 196, 15, 0.2);
}

body.theme-abeille .transcription-header h3 {
    color: #f1c40f;
    font-family: 'Oswald', sans-serif;
}

body.theme-abeille .text-body {
    color: #e8d98e;
}

/* Modal */
body.theme-abeille .modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(241, 196, 15, 0.4);
}

body.theme-abeille .modal-content h2 {
    color: #f1c40f;
}

body.theme-abeille .close-modal {
    color: #c8b560;
}

body.theme-abeille .close-modal:hover {
    color: #f1c40f;
}

body.theme-abeille .form-group label {
    color: #f0d060;
}

body.theme-abeille .form-group input,
body.theme-abeille .form-group textarea {
    background: #0d0d0d;
    border-color: rgba(241, 196, 15, 0.3);
    color: #fef9e7;
}

/* Footer abeille */
body.theme-abeille footer {
    background: linear-gradient(160deg, #1a1a1a 0%, #2c3e50 100%);
    border-top-color: #f1c40f;
}

body.theme-abeille .footer-heading {
    color: #f1c40f;
}

body.theme-abeille .footer-links ul li a {
    color: #c8b560;
}

body.theme-abeille .footer-links ul li a i {
    color: #f1c40f;
}

body.theme-abeille .footer-links ul li a:hover {
    color: #f1c40f;
}

body.theme-abeille .footer-credits p {
    color: #c8b560;
}

body.theme-abeille .footer-credits strong {
    color: #fef9e7;
}

body.theme-abeille .footer-desc {
    color: #c8b560;
}

body.theme-abeille .footer-bottom {
    border-top-color: rgba(241, 196, 15, 0.25);
}

body.theme-abeille .footer-bottom p {
    color: #c8b560;
}


/* Responsive Header */
@media (max-width: 768px) {
    .auth-btn, .theme-picker-wrapper {
        display: none !important;
    }
}

/* Green Theme Specifics */
#slugBtn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
}

body.theme-vert #slugBtn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}

.header-right {
    gap: 15px !important;
}

/* Theme Picker */
.theme-picker-wrapper {
    position: relative;
}

.theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.theme-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(20deg) scale(1.05);
}

body.theme-nuit .theme-btn {
    background: #1a1a1a;
    border-color: #30363d;
    color: #7eb8f7;
}

body.theme-abeille .theme-btn {
    background: #1a1a1a;
    border-color: #f1c40f;
    color: #f1c40f;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px;
    z-index: 1100;
    min-width: 160px;
    animation: themeMenuAppear 0.25s ease;
}

body.theme-nuit .theme-menu {
    background: rgba(22, 27, 34, 0.98);
    border-color: #30363d;
}

body.theme-abeille .theme-menu {
    background: rgba(20, 20, 20, 0.97);
    border: 1px solid #f1c40f;
}

.theme-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 10px;
}

@keyframes themeMenuAppear {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

body.theme-nuit .theme-option {
    color: #e6edf3;
}

body.theme-abeille .theme-option {
    color: #fef9e7;
}

.theme-option:hover {
    background: rgba(74, 144, 226, 0.1);
}

body.theme-nuit .theme-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-option-special {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 4px;
    padding-top: 12px;
}

.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.theme-swatch-bee {
    background: repeating-linear-gradient(
        45deg,
        #f1c40f,
        #f1c40f 4px,
        #2c3e50 4px,
        #2c3e50 8px
    );
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(-45deg, var(--bg-color-1), var(--bg-color-2), var(--bg-color-1), #fdfaf5);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    font-family: 'Oswald', sans-serif;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    height: 90px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

header img.logo {
    height: 60px; /* Slightly larger for center logo */
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.header-left img.logo {
    height: 50px;
}

.header-left a {
    display: inline-flex;
    border-radius: var(--radius-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.header-left a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25);
}

/* Logo central cliquable (retour accueil) - Desktop uniquement */
.logo-home-link {
    display: inline-flex;
    border-radius: var(--radius-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.logo-home-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25);
}

@media (max-width: 768px) {
    .logo-home-link {
        pointer-events: none;
        cursor: default;
    }
}

main {
    max-width: 600px;
    /* Mobile focused max-width */
    margin: 0 auto;
    padding: 20px;
}

.story-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.2;
}

/* Modern Carousel */
.carousel-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    aspect-ratio: 16 / 9;
    /* Landscape ratio, less vertical space */
}

.carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide {
    min-width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #cbd5e0;
    position: relative;
}

/* Gradient Overlay on Slide */
.slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    pointer-events: none;
    /* Allows clicking on the slide behind if needed, buttons will re-enable pointer-events */
}

.nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

.nav-btn:hover {
    background: white;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .nav-btn {
        width: 64px;
        height: 64px;
        font-size: 1.8rem;
        background: rgba(255, 255, 255, 0.45);
        border: 2px solid rgba(255, 255, 255, 0.7);
    }

    .carousel-nav {
        padding: 0 10px;
    }
}

/* Audio Track Tabs */
.audio-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: -2px;
    padding-left: 20px;
}

.audio-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 12px 12px 0 0;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audio-tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-color);
}

.audio-tab.active {
    background: rgba(255, 255, 255, 0.82);
    color: var(--primary-color);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 2;
}

/* Sleek Audio Player (Updated Design) */
.audio-player {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 25px 25px 15px 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

/* 1. Progress Bar (Top) */
.progress-bar-container {
    height: 6px;
    background: #edf2f7;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 8px;
    /* Space between bar and time */
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    /* background: #f6b93b; Old accent */
    background: var(--primary-color);
    width: 0%;
    border-radius: 6px;
    position: relative;
}

/* Remove the old dot for now to match sleek bar, or keep if user wants handle. Image shows clean bar. */
.progress-fill::after {
    display: none;
}

/* 2. Time Display */
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
    /* Grey text */
    margin-bottom: 25px;
    font-weight: 500;
}

/* 3. Controls Row */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Playback Group (Center-Left) */
.playback-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn.outline-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn.outline-btn:hover {
    border-color: var(--primary-color);
    background: #ebf8ff;
}

.play-pause-btn {
    width: 65px;
    height: 65px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(133, 158, 206, 0.3);
    transition: transform 0.2s;
}

.play-pause-btn:hover {
    transform: scale(1.05);
}

/* Volume Group (Right) */
.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-icon {
    color: var(--text-light);
    font-size: 1rem;
}

.volume-slider-visual {
    width: 80px;
    height: 4px;
    background: #edf2f7;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-level {
    width: 60%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
}

.volume-knob {
    position: absolute;
    left: 60%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Transcription Accordion */
.transcription-section {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.transcription-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: white;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.transcription-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 1.2rem;
    color: var(--accent-color);
    transition: transform 0.3s;
}

.transcription-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 25px;
    opacity: 0;
}

.transcription-section.open .transcription-header {
    border-bottom: 1px solid #edf2f7;
}

.transcription-section.open .toggle-icon {
    transform: rotate(180deg);
}

.transcription-section.open .transcription-content {
    max-height: 1000px;
    padding: 25px;
    opacity: 1;
}

.text-body {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1.15rem;
}

/* Authentication & Webmaster Styles */

/* Header Auth Button */
.auth-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Oswald', sans-serif;
    transition: all 0.2s;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn i {
    display: none;
}

.auth-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .auth-btn {
        padding: 0;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        justify-content: center;
    }
    .auth-btn-text {
        display: none;
    }
    .auth-btn i {
        display: block;
        font-size: 1.1rem;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

#loginModal h2 {
    white-space: nowrap;
    text-align: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    #loginModal h2 {
        font-size: 1.15rem;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.submit-btn:hover {
    background: var(--accent-color);
}

.error-msg {
    color: red;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Administrateur Mode Indicators & Controls */
body.administrateur-mode {
    border-top: 5px solid #ff9f43;
    /* Visual indicator */
}



.wm-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.wm-toolbar {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 15px;
    align-items: center;
    font-weight: bold;
}

.wm-logout {
    background: white;
    color: #e74c3c;
    border: none;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Edit Controls injected by JS */
.wm-edit-btn {
    position: absolute;
    background: #ff9f43;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 20;
    font-size: 1rem;
}

.wm-edit-btn:hover {
    transform: scale(1.1);
}

/* Specific positions */
.carousel-container .wm-add-img {
    top: 10px;
    right: 10px;
}

.carousel-container .wm-del-img {
    top: 10px;
    left: 10px;
    background: #e74c3c;
}

.audio-player {
    position: relative;
}

.audio-player .wm-edit-audio {
    position: absolute;
    top: -10px;
    right: -10px;
}

.transcription-section {
    position: relative;
}

.transcription-section .wm-edit-text {
    position: absolute;
    top: 15px;
    right: 50px;
    /* Left of toggle icon */
}

.hidden {
    display: none !important;
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(160deg, var(--bg-color-2) 0%, var(--bg-color-1) 100%);
    border-top: 3px solid var(--primary-color);
    padding: 60px 5% 0;
    margin-top: 60px;
    color: var(--text-secondary);
    box-shadow: 0 -8px 30px rgba(74, 144, 226, 0.08);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 50px;
}

.footer-logo {
    height: 48px;
    width: auto;
    margin-bottom: 16px;
    display: block;
    border-radius: 8px;
}

.footer-desc {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 300px;
}

.footer-heading {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 18px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease, gap 0.2s ease;
}

.footer-links ul li a i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    gap: 12px;
}

.footer-credits {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-credits p {
    font-family: 'Oswald', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.footer-credits p i {
    color: var(--primary-color);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.footer-credits strong {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.82rem;
    font-family: 'Oswald', sans-serif;
    color: var(--text-secondary);
    opacity: 0.85;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-desc {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    footer {
        padding: 40px 6% 0;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 36px;
    }
    .footer-brand {
        grid-column: auto;
    }
}

/* Dark mode footer */
body.theme-nuit footer {
    background: linear-gradient(160deg, #161b22 0%, #0d1117 100%);
    border-top-color: #30363d;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

body.theme-nuit .footer-bottom {
    border-top-color: #30363d;
}

body.theme-nuit .footer-links ul li a {
    color: #8b949e;
}

body.theme-nuit .footer-links ul li a:hover {
    color: var(--primary-color);
}

body.theme-nuit .footer-credits p {
    color: #8b949e;
}

body.theme-nuit .footer-credits strong {
    color: #c9d1d9;
}

body.theme-nuit .footer-desc {
    color: #8b949e;
}

body.theme-nuit .footer-bottom p {
    color: #6e7681;
}

/* Admin Default Theme Modal */
.theme-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 5px;
}

.theme-select-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    color: #2c3e50;
    text-align: left;
}

.theme-select-btn:hover {
    background: #f1f2f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.theme-select-btn.active {
    border-color: #8e44ad;
    background: #f3e5f5;
    color: #6a1b9a;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.2);
}

.theme-select-btn .theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}
