/* ========== VARIABLES TORRIDES ========== */
:root {
    --primary: #C41E3A; /* Rouge passion */
    --secondary: #8B0000; /* Rouge sombre */
    --accent: #FF1744; /* Rose vif */
    --dark: #1a0000;
    --light: #2a0a0a;
    --text: #fff;
    --shadow: rgba(196, 30, 58, 0.5);
}

/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== CORRECTION ÉMOJIS ===== */
.emoji-white {
    color: white !important;
    filter: brightness(1) !important;
    opacity: 1 !important;
    display: inline-block;
}

h1 .emoji-white,
h2 .emoji-white,
h3 .emoji-white {
    color: white !important;
}

.settings-btn .emoji-white {
    font-size: 1.2em;
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1a0000 0%, #4a0000 100%);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

/* ========== PAGES ========== */
.page {
    display: none;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ===== NAVIGATION ===== */
.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-links a.active {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ✅ Forcer les émojis en blanc dans la navigation */
.nav-links a span {
    filter: brightness(1) !important;
    opacity: 1 !important;
}

/* ========== PAGE CONNEXION SENSUELLE ========== */
#login-page {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0000 0%, #2a0a0a 50%, #4a0000 100%);
    position: relative;
    overflow: hidden;
}

#login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.6; }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #C41E3A, transparent),
        radial-gradient(2px 2px at 60% 70%, #FF1744, transparent),
        radial-gradient(1px 1px at 50% 50%, #C41E3A, transparent),
        radial-gradient(1px 1px at 80% 10%, #FF1744, transparent);
    background-size: 200% 200%;
    animation: particles 15s linear infinite;
    opacity: 0.4;
}

@keyframes particles {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%, 80% 20%; }
    50% { background-position: 100% 100%, 0% 0%, 80% 80%, 20% 60%; }
}

.login-container {
    background: rgba(10, 0, 0, 0.9);
    padding: 3rem;
    border-radius: 20px;
    border: 2px solid var(--primary);
    box-shadow: 0 20px 60px rgba(196, 30, 58, 0.6), 
                0 0 100px rgba(255, 23, 68, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.site-title {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 3px;
}

/* Gradient UNIQUEMENT sur le texte, PAS sur l'émoji */
.site-title .text-gradient {
    background: linear-gradient(135deg, #C41E3A, #FF1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Forcer l'émoji en blanc */
.site-title .emoji-white {
    -webkit-text-fill-color: #FFFFFF !important;
    background: none !important;
    filter: none !important;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px var(--accent));
}

input[type="password"] {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid var(--primary);
    background: rgba(42, 10, 10, 0.8);
    color: var(--text);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow), 
                0 0 20px rgba(255, 23, 68, 0.5);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 23, 68, 0.6);
}

.error-message {
    display: none;
    color: #ff5252;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

/* ========== PAGE BIBLIOTHÈQUE SENSUELLE ========== */
#library-page {
    background: linear-gradient(135deg, #0a0000 0%, #2a0a0a 100%);
}

.header {
    background: linear-gradient(135deg, #1a0000 0%, #3a0000 100%);
    padding: 1.5rem 2rem;
    box-shadow: 0 5px 30px rgba(196, 30, 58, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
}

.header h2 {
    font-size: 1.8rem;
    font-weight: 300;
}

.header h2 .text-gradient {
    background: linear-gradient(135deg, #C41E3A, #FF1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h2 .emoji-white {
    -webkit-text-fill-color: #FFFFFF !important;
}


.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 15px rgba(196, 30, 58, 0.4);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(255, 23, 68, 0.6);
}

.library-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.recits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.recit-card {
    background: linear-gradient(135deg, rgba(26, 0, 0, 0.9) 0%, rgba(58, 0, 0, 0.9) 100%);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid transparent;
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.3);
    cursor: pointer;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.recit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196, 30, 58, 0.3), transparent);
    transition: left 0.5s;
}

.recit-card:hover::before {
    left: 100%;
}

.recit-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(255, 23, 68, 0.6),
                0 0 50px rgba(196, 30, 58, 0.3);
}

.recit-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--accent));
}

.recit-card h3 {
    background: linear-gradient(135deg, #C41E3A, #FF1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.recit-extrait {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.recit-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.recit-duration {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-badge {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85em;
}

/* ========== PAGE LECTEUR SENSUELLE ========== */
#reader-page {
    background: linear-gradient(135deg, #0a0000 0%, #1a0000 100%);
}

.back-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 3px 15px rgba(196, 30, 58, 0.4);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(255, 23, 68, 0.6);
}

.settings-btn {
    padding: 10px 15px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.settings-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
}

.reader-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#reader-text {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    scroll-behavior: smooth;
}

#reader-text::-webkit-scrollbar {
    width: 12px;
}

#reader-text::-webkit-scrollbar-track {
    background: rgba(26, 0, 0, 0.5);
}

#reader-text::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
}

#reader-text::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent), var(--primary));
}

.progress-container {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #1a0000 0%, #2a0000 100%);
    box-shadow: 0 -5px 20px rgba(196, 30, 58, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 2px solid var(--primary);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(42, 10, 10, 0.8);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--primary);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.6);
}

.progress-percent {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: bold;
    min-width: 50px;
    text-align: right;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

/* ========== FORMATAGE DU TEXTE ========== */
#reader-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

#reader-text strong {
    color: var(--accent);
    font-size: 1.2em;
    display: block;
    margin: 2rem 0 1rem 0;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

/* ========== PANNEAU PARAMÈTRES ========== */
.settings-panel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: linear-gradient(135deg, #1a0000 0%, #2a0000 100%);
    border-left: 2px solid var(--primary);
    box-shadow: -5px 0 30px rgba(196, 30, 58, 0.5);
    padding: 2rem;
    transition: right 0.3s;
    z-index: 1000;
}

.settings-panel.active {
    right: 0;
}

.settings-panel h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.settings-panel h3 .text-gradient {
    background: linear-gradient(135deg, #C41E3A, #FF1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.setting-item {
    margin-bottom: 2rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.setting-item input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8B0000, #C41E3A);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 15px rgba(139, 0, 0, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(196, 30, 58, 0.6);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .recits-grid {
        grid-template-columns: 1fr;
    }
    
    #reader-text {
        padding: 1.5rem;
        font-size: 16px;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
}
