/* ========================================
   CHRONICLE - INDEX.CSS
   Styles spécifiques à la page d'accueil
   ======================================== */

/* Importe les styles communs */
@import url('common.css');

/* ========================================
   RESET ET BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    display: block;  /* Assurer que body n'interfère pas */
}


/* ========================================
   LOGIN 
   ======================================== */
.user-welcome {
    text-align: center;
    margin-bottom: 20px;
}

.user-welcome h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.user-stats-mini {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9em;
    color: #FFE5B4;
}

.user-actions-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.5);
}

.info-text {
    text-align: center;
    color: #FFE5B4;
    margin-bottom: 20px;
    font-size: 0.95em;
}


#authStatus {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

#authStatus button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: var(--primary-color, #667eea);
    color: white;
}

#authStatus button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#authStatus .username {
    font-weight: 600;
    color: var(--text-color, #333);
}

.auth-logged-in, .auth-not-logged {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-icon {
    font-size: 1.2em;
}

.auth-text {
    color: #4CAF50;
    font-weight: bold;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-small.btn-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
    border: none;
}


/* ============================================================================
   LAYOUT PRINCIPAL - 3 Colonnes (Thèmes | Contenu | Langue+Auth)
   ============================================================================ */
/* Mode clair - par défaut */
.app-logo {
    content: url('/static/images/logo-chronicle.png');
    height: 300px;
}



.app-name {
    content: url('/static/images/ChroniCLE_Text.png');
    height: 100px;
}


/* Mode sombre */
[data-theme="dark"] .app-name {
    filter: brightness(1.8) saturate(1.2);
}

/* Mode sombre */
[data-theme="dark"] .app-logo {
    filter: brightness(1.8) saturate(1.2);
}

/* Responsive - plus petit sur mobile */
@media (max-width: 768px) {
    .app-logo {
        height: 45px;
    }
}


.main-layout {
	max-width: 1800px;
	margin: 0 auto;
    padding: 10px;
    display: grid;
    grid-template-columns: 300px 1fr 300px;  /* 3 colonnes : Thèmes | Contenu | Droite */
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    min-height: 100vh;
    padding: 20px;
}

/* Colonne gauche - Thèmes */
.themes-panel {
    grid-column: 1;
    grid-row: 1 / 3;  /* Occupe 2 lignes */
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}


.themes-panel h3 {
    color: var(--text-color, #333);
    margin: 0 0 15px 0;
}


/* Contenu principal */
.main-content {
    grid-column: 2;
    grid-row: 1 / 3;  /* Occupe 2 lignes */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
	background: var(--background-card, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    min-height: auto !important;
    padding-top: 20px !important;
	padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.main-content > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}


/* Titre + Version sur la même ligne */
.app-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.version-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(109, 40, 217, 0.15);
    color: #6d28d9;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Subtitle collé au titre */
.subtitle {
    margin: 0.3rem 0 0 0;
    font-size: 0.9rem;
    color: #666;
	text-align: center;
}


/* Emoji moins d'espace */
.app-emoji {
    font-size: 3rem;
    margin: 0.8rem 0;
}



/* ✅ COLONNE DROITE - Langue + Auth */
.right-column {
	grid-column: 3;
    grid-row: 1 / 3;  /* Occupe 2 lignes */
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: start;  /* Aligne en haut */
}

/* Help panel - En bas sur toute la largeur */
.help-panel {
    grid-column: 1 / -1;  /* Occupe toutes les colonnes */
    grid-row: 3;
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* User status panel (si existe encore) - À supprimer ou cacher */
.user-status-panel {
    display: none;  /* On utilise auth-status-panel à la place */
}


.theme-option {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* ========================================
   CONTENU PRINCIPAL (Centre)
   ======================================== */

.container {
    max-width: 600px;
    width: 90%;
}

.title-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

.title-row .app-title {
    margin: 0 !important;
    width: auto !important;
    display: inline-block !important;
}

.title-row .version-badge {
	background: linear-gradient(135deg, #FFD700, #FFA500);
    font-size: 0.7rem;
    padding: 2px 2px;
    color: #8B4513;
    border-radius: 5px;
    white-space: nowrap;
    font-weight: bold;
	margin-top: 20px;
    margin-bottom: 10px;
}


.app-title {
    margin: 0;
}


/* Titre et badges */
.app-title, .title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: var(--text-primary, white);
}



.version-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B4513;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: bold;
    margin-bottom: 20px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	border-radius: 10px;
}

.app-emoji {
    font-size: 4em;
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.app-emoji:hover {
    transform: scale(1.1);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-8px); }
}


/* ========================================
   SECTIONS INFORMATIVES
   ======================================== */
.auth-actions-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.auth-actions-panel button {
    display: block;
    width: 100%;
    margin: 8px 0;
}

.story-intro {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    font-size: 1.1em;
    line-height: 1.6;
    border-left: 5px solid #FFD700;
    position: relative;
}

.story-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

.story-intro h3 {
    color: #FFD700;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* Grille de fonctionnalités */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.feature-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: white;
    font-size: 1.1em;
}

.feature-desc {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Sections avantages et aperçu */
.benefits {
    background: rgba(76, 175, 80, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
    border: 2px solid rgba(76, 175, 80, 0.3);
    backdrop-filter: blur(10px);
}

.benefits h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.benefits ul {
    list-style: none;
    text-align: left;
}

.benefits li {
    margin: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.benefits li::before {
    content: "✅";
    position: absolute;
    left: 0;
    font-size: 1.1em;
}

.benefits li:hover {
    transform: translateX(5px);
}

.chapter-preview {
    background: rgba(156, 39, 176, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
    border: 2px solid rgba(156, 39, 176, 0.3);
    backdrop-filter: blur(10px);
}

.chapter-preview h3 {
    color: #9C27B0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapters-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.9em;
}

.chapter-item {
    text-align: left;
    padding: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* ========================================
   FORMULAIRE
   ======================================== */
.form-section {
    margin: 25px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: bold;
    color: #FFE5B4;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Boutons */
.buttons-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary, .start-button {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
}

.btn-secondary, .select-pack-button {
    background: linear-gradient(45deg, #9C27B0, #673AB7);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Animation pulse pour bouton start */
.start-button:not(:disabled),
.btn-primary:not(:disabled) {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 5px 25px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.2); }
}

/* Info pack sélectionné */
.selected-pack-info {
	margin: 15px 0;
    padding: 12px 20px;
    background: rgba(255, 229, 180, 0.1);
    border: 1px solid rgba(255, 229, 180, 0.3);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}


@keyframes slideInFromTop {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   COLONNE DROITE - Langue + Auth
   ============================================================================ */

/* Panneau langue (existant, ajuster si besoin) */
.language-panel {
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 180px;
}

.language-panel h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--text-color, #333);
}

.language-option {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.language-option.active {
    background: var(--primary-color, #667eea);
    color: white;
    border-color: var(--primary-color, #667eea);
}

/* Panneau Auth - EN DESSOUS */
.auth-status-panel {
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 180px;
}

#authStatus {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#authStatus button {
    padding: 10px 15px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 10px;
    background: var(--background-color, white);
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    text-align: center;
}

#authStatus button:hover {
    background: var(--hover-background, #f0f4ff);
    border-color: var(--primary-color, #667eea);
    transform: translateY(-2px);
}

#authStatus .username-display {
    padding: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--text-color, #333);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .right-column {
        position: static;
        margin: 20px auto;
        max-width: 300px;
    }
}

/* ========================================
   ZONE D'AIDE
   ======================================== */
.help-panel {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 150px;
    overflow-y: auto;
}

.help-panel h4 {
    color: #FFD700;
    font-size: 1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-output {
    font-size: 0.9em;
    line-height: 1.4;
}

.help-message {
    margin: 3px 0;
    padding: 2px 0;
}

.help-success { color: #4CAF50; }
.help-error { color: #ff6b6b; }
.help-info { color: #FFD700; }
.help-warning { color: #FF9800; }


/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2em;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #FFD700;
    transform: scale(1.1);
}

/* Liste des packs */
.packs-list {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.pack-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pack-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

.pack-item.selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.pack-item:first-child,
.story-card:first-child {
    background: rgba(30, 40, 80, 0.9);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

/* Autres packs (légèrement plus clairs) */
.pack-item:not(:first-child),
.story-card:not(:first-child) {
    background: rgba(60, 70, 110, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Hover sur les autres packs */
.pack-item:not(:first-child):hover,
.story-card:not(:first-child):hover {
    background: rgba(70, 80, 120, 0.8);
    border-color: rgba(255, 215, 0, 0.3);
}


/* Bouton déployer la liste */
.expand-toggle,
.section-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    margin-top: 8px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px dashed rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    color: rgba(255, 215, 0, 0.9);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-toggle:hover,
.section-toggle:hover {
    background: rgba(255, 215, 0, 0.25);
    border-style: solid;
}

/* Icône animée */
.expand-toggle::after,
.section-toggle .toggle-icon {
    content: '▼';
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.expand-toggle.expanded::after,
.section-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}


/* Badge "5 autres histoires" */
.pack-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 180, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    color: rgba(255, 215, 0, 0.95);
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.2); }
}

.pack-count-badge:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 180, 0, 0.2));
}


.recommend-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B4513;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pack-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
}

.pack-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.category-mini {
    background: rgba(156, 39, 176, 0.2);
    border: 1px solid rgba(156, 39, 176, 0.4);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.85em;
    color: #E1BEE7;
}


.category-mini-secondaire {
    background: rgba(222, 175, 166, 0.3);          /* ✅ ROUGE vif pour test */
    border: 1px solid rgba(255, 0, 0, 0.6);   /* ✅ Bordure rouge */
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.85em;
    color: #5C4D4B;                            /* ✅ Texte rouge */
}


.pack-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    flex-wrap: wrap;
}

.pack-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   FOOTER
   ======================================== */
.footer-info {
    margin-top: 30px;
    font-size: 0.9em;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
}

/* ========================================
   MESSAGES FLASH
   ======================================== */
.flashes {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 0;
    font-weight: bold;
}

.flash-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.flash-error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}

.flash-info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 1px solid #2196F3;
}

.flash-warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid #FF9800;
}

/* ========================================
   ÉTATS DE CHARGEMENT
   ======================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
}




@keyframes spin {
    to { transform: rotate(360deg); }
}



/* ========================================
   PANNEAU UTILISATEUR
   ======================================== */
.user-status-panel {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-status-panel h4 {
    color: #FFD700;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
}

.user-stats-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #FFD700;
}

.user-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.user-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
}
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .themes-panel, .language-panel {
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 15px;
    }
    
    .theme-option, .language-option {
        flex: 1;
        margin: 0 5px;
    }
}

@media (max-width: 768px) {
    .features-grid, .chapters-list {
        grid-template-columns: 1fr;
    }
    
    .buttons-row {
        flex-direction: column;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .app-title {
        font-size: 2em;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .pack-meta {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .app-emoji {
        font-size: 3em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .feature-icon {
        font-size: 2em;
    }
}


/* ============================================================================
   MODAL PACK BROWSER - Layout Enrichi (Compatible Thèmes)
   ============================================================================ */

/* Modal plus large */
.modal-content-large {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Header modal */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.1));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-color, white);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color, #333);
}

/* Layout 2 colonnes */
.pack-browser-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
    flex: 1;
    background: var(--background-color, white);
}

/* ============================================================================
   COLONNE GAUCHE : Packs
   ============================================================================ */

.packs-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Filtres - CORRIGÉ avec variables thème */
.filters-bar {
    background: var(--card-background, #f8f9fa);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.filters-bar h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-color, #333);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.7rem;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    background: var(--background-color, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color, #333);
}


.filter-checkbox:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.btn-reset-filters {
    width: 100%;
    padding: 0.5rem;
    background: var(--background-color, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
    color: var(--text-color, #333);
}

.btn-reset-filters:hover {
    background: var(--hover-background, #f5f5f5);
}

/* Liste packs */
.packs-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.packs-count {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-primary, #666);
}

.packs-grid {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;  /* Garder en colonne */
    gap: 0.5rem;  /* Réduire l'espace entre cartes */
    padding-right: 0.5rem;
}


/* Card pack */
.pack-card {
    background: var(--card-background, white);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
}

.pack-card:hover {
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 4px 12px var(--shadow-color, rgba(102, 126, 234, 0.15));
    transform: translateY(-2px);
}

.pack-card.selected {
    border-color: var(--primary-color, #667eea);
    background: var(--selected-background, linear-gradient(135deg, #f0f4ff 0%, #fff 100%));
}

.pack-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.hsk1-pack-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color, #333);
}

.pack-badge {
    padding: 0.25rem 0.75rem;
    background: var(--primary-color, #667eea);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}


.pack-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    margin: 0.5rem 0;
    line-height: 1.5;
}


.pack-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary, #888);
}

.pack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pack-tag {
    padding: 0.25rem 0.5rem;
    background: var(--tag-background, #f0f4ff);
    color: var(--primary-color, #667eea);
    border-radius: 6px;
    font-size: 0.75rem;
}

/* ============================================================================
   COLONNE DROITE : Profil User - CORRIGÉ
   ============================================================================ */

.user-profile-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Cards profil - CORRIGÉ avec backgrounds visibles */
.profile-card {
    background: var(--card-background, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.25rem;
}

.profile-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-color, #333);
}

/* Backgrounds différenciés pour chaque type */
.profile-card-strengths {
    background: var(--card-background, #f0fdf4);
    border-color: var(--border-color, #bbf7d0);
}

.profile-card-weaknesses {
    background: var(--card-background, #fef2f2);
    border-color: var(--border-color, #fecaca);
}

.profile-card-recommendations {
    background: var(--card-background, #fffbeb);
    border-color: var(--border-color, #fde68a);
}

.placeholder-text {
    color: var(--text-tertiary, #999);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Items profil */
.strength-item,
.weakness-item,
.recommendation-item {
    padding: 0.75rem;
    background: var(--background-color, white);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid;
}

.strength-item {
    border-left-color: #10b981;
}

.weakness-item {
    border-left-color: #ef4444;
}

.recommendation-item {
    border-left-color: #fbbf24;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-item:hover {
    background: var(--hover-background, #fffbeb);
    transform: translateX(3px);
}

.item-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color, #333);
}

.item-percentage {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.item-progress {
    height: 6px;
    background: var(--progress-bg, rgba(0,0,0,0.1));
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.item-progress-fill {
    height: 100%;
    background: currentColor;
    transition: width 0.6s ease;
}

/* Loading */
.loading-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-color, #333);
}

.spinner {
    width: 40px;
    height: 20px;
    margin: 0 auto 1rem;
    border: 4px solid var(--spinner-bg, rgba(102, 126, 234, 0.2));
    border-top-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 992px) {
    .pack-browser-layout {
        grid-template-columns: 1fr;
    }
    
    .user-profile-section {
        max-height: 400px;
    }
}


/* ===== SECTION MODE DÉBUTANT ===== */

.divider-with-text {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider-with-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

.divider-with-text span {
    background: var(--bg-primary, #ffffff);
    padding: 0 20px;
    position: relative;
    color: #999;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.beginner-mode-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 15px;
    border: 2px solid #bae6fd;
    text-align: center;
}

.mode-description {
    color: #64748b;
    margin: 10px 0 20px;
    font-size: 14px;
}

.btn-beginner {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-beginner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-icon {
    font-size: 20px;
}

.mode-features {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.feature-badge {
    background: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    color: #06b6d4;
    border: 1px solid #e0f2fe;
}

/* ===== MODAL NIVEAUX HSK1 ===== */

.modal-content-medium {
    max-width: 800px;
    width: 90%;
}

.hsk1-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.level-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.level-card:hover {
    transform: translateY(-5px);
    border-color: #06b6d4;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.level-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.level-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #374151;
}

.level-emoji {
    font-size: 30px;
}

.level-card h3 {
    margin: 10px 0;
    color: #1f2937;
    font-size: 18px;
}

.level-card p {
    color: #6b7280;
    font-size: 14px;
    margin: 10px 0;
}

.level-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.info-item {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-select-level {
    background: #06b6d4;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-select-level:hover {
    background: #0891b2;
    transform: scale(1.02);
}

.level-card-complete {
    grid-column: span 2;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}

.level-card-complete:hover {
    border-color: #f59e0b;
}

.btn-complete {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-complete:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .hsk1-levels-grid {
        grid-template-columns: 1fr;
    }
    
    .level-card-complete {
        grid-column: span 1;
    }
    
    .mode-features {
        flex-direction: column;
        align-items: center;
    }
}

/* Descriptions des modes */
.modes-descriptions {
    margin-top: 20px;
    min-height: 80px;
    position: relative;
}

.mode-desc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: absolute;
    width: 100%;
    display: none; /* Hidden by default */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-desc.show {
    display: flex !important;
    gap: 15px;
    align-items: flex-start;
}

.mode-desc.active {
    opacity: 1;
    transform: translateY(0);
}

.desc-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.desc-content {
    flex: 1;
}

.desc-content h4 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.desc-content p {
    margin: 0 0 12px 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.desc-features {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.desc-badge {
    background: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #475569;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Couleurs spécifiques par mode */
#desc-adventure {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border-color: #fbbf24;
}

#desc-adventure .desc-badge {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

#desc-pack {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #a78bfa;
}

#desc-pack .desc-badge {
    background: #f9fafb;
    border-color: #e9d5ff;
    color: #6b21a8;
}

#desc-beginner {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #38bdf8;
}

#desc-beginner .desc-badge {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
}


/* Mobile */
@media (max-width: 768px) {
    .modes-descriptions {
        min-height: 100px;
    }
    
    .desc-features {
        flex-direction: column;
        align-items: flex-start;
    }
}


.hsk-filters-container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    gap: 15px;
}

/* Groupe HSK 2+ (gauche) */
.hsk-story-group {
    display: flex;
    gap: 15px;
    flex: 1;
}

/* Séparateur vertical */
.hsk-vertical-separator {
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, transparent, #cbd5e1, transparent);
    position: relative;
}

/* Ajout du texte "ou" sur le séparateur */
.hsk-vertical-separator::after {
    content: 'ou';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f8fafc;
    padding: 2px 8px;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Groupe HSK1 (droite) */
.hsk1-group {
    padding: 0 5px;
}

/* Style spécial pour HSK1 */
.hsk1-checkbox {
    position: relative;
}

.hsk1-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-text {
    font-weight: 600;
    color: #0891b2;
}

.level-badge-mini {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0c4a6e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #7dd3fc;
}

/* États actifs/inactifs */
.hsk1-checkbox input:checked ~ .hsk1-label .level-text {
    color: #0891b2;
}

.hsk1-checkbox input:checked ~ .hsk1-label .level-badge-mini {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-color: #0891b2;
}

/* Quand HSK1 est actif, griser les autres */
.hsk-story-group.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.hsk-story-group.disabled label {
    cursor: not-allowed;
}

/* Quand HSK 2+ est actif, griser HSK1 */
.hsk1-group.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.hsk1-group.disabled label {
    cursor: not-allowed;
}

/* Animation de transition */
.hsk-filters-container {
    transition: all 0.3s ease;
}

/* Hover effects */
.hsk1-checkbox:hover .level-badge-mini {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.filter-checkbox {
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    transform: translateY(-1px);
}

/* Indicateur visuel du mode actif */
.hsk-filters-container.hsk1-mode {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #38bdf8;
}

.hsk-filters-container.story-mode {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 20%, #f8fafc 100%);
    border: 1px solid #fbbf24;
}


/* Mobile responsive */
@media (max-width: 768px) {
    .hsk-filters-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .hsk-story-group {
        width: 100%;
        justify-content: space-around;
    }
    
    .hsk-vertical-separator {
        width: 100%;
        height: 1px;
        margin: 5px 0;
    }
    
    .hsk1-group {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

const cssFixPermanent = `
/* Empêcher la classe disabled de bloquer les clicks */
.hsk1-group.disabled,
.hsk-story-group.disabled {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Utiliser opacity pour l'effet visuel au lieu de pointer-events */
.hsk1-group,
.hsk-story-group,
#hsk1Filter,
.hsk-story {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ne JAMAIS utiliser pointer-events: none sur ces éléments */
.filter-checkbox input {
    pointer-events: auto !important;
    cursor: pointer !important;
}
`;

const hsk1PackStyles = `
<style>
/* Cards HSK1 */
.hsk1-pack-card {
    /* Reprendre le style exact des pack-card */
    background: var(--card-background);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    /* Retirer les styles custom HSK1 */
    max-height: none;
    display: block;
    flex-direction: unset;
    overflow: visible;
}


/* Header plus compact */
.hsk1-pack-card .pack-header {
    /* Reset et utiliser pack-card-header à la place */
    all: unset;
}


/* Utiliser le même style que pack-card-header */
.hsk1-pack-card .pack-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

/* Badge HSK1 comme le badge HSK des content packs */
.hsk1-pack-card .pack-type-badge {
    background: var(--primary-color, #667eea);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    /* Même style que .pack-badge */
}


/* Icône plus petite */
.hsk1-pack-card .pack-icon {
    font-size: 20px;
    margin-bottom: 0rem;
	justify-content: right;
}


/* Body avec scroll si nécessaire */
.hsk1-pack-card .pack-body {
    flex: 1;
    padding: 0 0.75rem;
    display: grid
    grid-template-areas: 
        "title stats"
        "desc tags"
        "footer footer";
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto 1fr;
    gap: 0.5rem;
}


/* Titre plus petit */
.hsk1-pack-card .pack-title {
    grid-area: title;
    font-size: 1.1rem;
    margin: 0;
    align-self: right;
}


/* Description tronquée */
.hsk1-pack-card .pack-description {
    color: var(--text-secondary, #888);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    /* Pas de limitation de hauteur */
    max-height: none;
    white-space: normal;
    overflow: visible;
}


.hsk1-pack-card .pack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}



/* Stats plus compacts */
.hsk1-pack-card .pack-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-muted, #999);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    /* Même style que .pack-meta */
}


.hsk1-pack-card .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


.hsk1-pack-card .tag-mini {
    background: var(--tag-bg, #f0f0f0);
    color: var(--text-secondary, #555);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}


/* Footer fixe en bas */
.hsk1-pack-card .pack-footer {
    all: unset;
    margin-top: 1rem;
    text-align: right;
}


/* Bouton plus petit */
.hsk1-pack-card .btn-select-pack {
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}


.hsk1-pack-card .btn-select-pack:hover {
    background: var(--primary-hover, #5a67d8);
    transform: translateY(-1px);
}


/* Si en grille, forcer hauteur uniforme */
.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 320px;  /* Hauteur fixe */
    gap: 1.5rem;
}



.hsk1-pack-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.hsk1-pack-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.pack-featured {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.pack-header {
    padding: 20px;
    position: relative;
}

.pack-icon-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pack-icon {
    font-size: 48px;
}

.featured-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pack-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.pack-body {
    padding: 0 20px 20px;
    flex: 1;
}

.pack-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}


.pack-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #475569;
}

.stat-icon {
    font-size: 16px;
}

.pack-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag-mini {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.tag-more {
    background: #e2e8f0;
    color: #64748b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pack-footer {
    padding: 15px 20px;
    border-top: 1px solid #f1f5f9;
}

.btn-select-pack {
    width: 100%;
    padding: 12px;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-select-pack:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}


</style>
`;

#startButton {
    position: relative;
    transition: all 0.3s ease;
}

/* État désactivé (aucun pack sélectionné) */
#startButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
    transform: scale(0.95);
}

#startButton:disabled::after {
    content: '🔒';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

/* État activé (pack sélectionné) */
#startButton:not(:disabled) {
    cursor: pointer;
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

#startButton:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* Animation pulse quand prêt */
#startButton:not(:disabled) {
    animation: pulseReady 2s ease-in-out infinite;
}

@keyframes pulseReady {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0);
    }
}

.selected-pack-info.pack-selected {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    animation: packSelected 0.5s ease;
}

.selected-pack-info.pack-selected #selectedPackText {
    color: #4CAF50;
}

@keyframes packSelected {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Container pour bouton en bas de sidebar */
.sidebar-bottom {
    margin-top: auto;  /* ✅ Pousse vers le bas */
    padding: 1rem;
    border-top: 1px solid rgba(255, 229, 180, 0.2);
}

/* Bouton Guide */
.sidebar-tutorial-btn {
    width: 100%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.sidebar-tutorial-btn:active {
    transform: translateY(0);
}

.sidebar-tutorial-btn .btn-icon {
    font-size: 1.2em;
}

/* S'assurer que la sidebar utilise flexbox */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;  /* ✅ Important pour que margin-top: auto fonctionne */
}


/* ============================================== */
/*  Container principal des filtres - HORIZONTAL  */
.filters-bar-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-background, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}


/* ===== GROUPE HSK - Pills toggleables ===== */
.hsk-pills-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hsk-pills-group .group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
}

/* Pills HSK individuelles */
.hsk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
    user-select: none;
}

.hsk-pill:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

/* État actif (sélectionné) */
.hsk-pill.active {
    background: var(--primary-color, #667eea);
    border-color: var(--primary-color, #667eea);
    color: white;
}

/* HSK1 avec style spécial "débutant" */
.hsk-pill.hsk1-pill {
    border-color: #06b6d4;
    color: #06b6d4;
}

.hsk-pill.hsk1-pill.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
    color: white;
}

.hsk-pill.hsk1-pill .beginner-badge {
    font-size: 0.65rem;
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Séparateur vertical entre HSK et Catégories */
.filters-separator {
    width: 1px;
    height: 28px;
    background: var(--border-color, #ddd);
    margin: 0 0.5rem;
}



/* ===== DROPDOWN CATÉGORIES ===== */
.categories-dropdown-wrapper {
    position: relative;
}

.categories-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
}

.categories-dropdown-trigger:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

.categories-dropdown-trigger.has-selection {
    border-color: var(--primary-color, #667eea);
    background: var(--selected-background, #f0f4ff);
}

.categories-dropdown-trigger .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.categories-dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Badge compteur de sélection */
.selection-count {
    background: var(--primary-color, #667eea);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Menu dropdown */
.categories-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    max-height: 350px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.categories-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--card-background, #f8f9fa);
    border-radius: 12px 12px 0 0;
}

.dropdown-header span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.btn-clear-categories {
    font-size: 0.75rem;
    color: var(--primary-color, #667eea);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.btn-clear-categories:hover {
    background: var(--hover-background, #f0f4ff);
}

/* Liste des catégories */
.dropdown-categories-list {
    padding: 0.5rem 0;
}

/* Catégorie principale (parent) */
.category-item {
    padding: 0;
}

.category-main {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.category-main:hover {
    background: var(--hover-background, #f5f5f5);
}

.category-main input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.category-main .category-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.category-main .category-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.category-main .expand-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary, #999);
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.category-item.expanded .expand-arrow {
    transform: rotate(90deg);
}

/* Sous-catégories (enfants) */
.subcategories-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--card-background, #fafafa);
}

.category-item.expanded .subcategories-list {
    max-height: 500px; /* Assez grand pour contenir les sous-cats */
}

.subcategory-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.subcategory-item:hover {
    background: var(--hover-background, #f0f0f0);
}

.subcategory-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.subcategory-item .subcat-score {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-tertiary, #999);
    background: var(--background-color, #eee);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ===== BOUTON RESET ===== */
.btn-reset-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-secondary, #666);
    margin-left: auto; /* Pousse à droite */
}

.btn-reset-compact:hover {
    background: var(--hover-background, #f5f5f5);
    color: var(--text-color, #333);
}

/* ===== COMPTEUR DE PACKS ===== */
.packs-count-compact {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.packs-count-compact .count-number {
    font-weight: 600;
    color: var(--primary-color, #667eea);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .filters-bar-compact {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .hsk-pills-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filters-separator {
        display: none;
    }
    
    .categories-dropdown-wrapper {
        width: 100%;
    }
    
    .categories-dropdown-trigger {
        width: 100%;
        justify-content: center;
    }
    
    .categories-dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .btn-reset-compact {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}




/* =====================
/* Container principal des filtres - HORIZONTAL */
.filters-bar-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-background, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}

/* ===== GROUPE HSK - Pills toggleables ===== */
.hsk-pills-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hsk-pills-group .group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
}

/* Pills HSK individuelles */
.hsk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
    user-select: none;
}

.hsk-pill:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

/* État actif (sélectionné) */
.hsk-pill.active {
    background: var(--primary-color, #667eea);
    border-color: var(--primary-color, #667eea);
    color: white;
}

/* HSK1 avec style spécial "débutant" */
.hsk-pill.hsk1-pill {
    border-color: #06b6d4;
    color: #06b6d4;
}

.hsk-pill.hsk1-pill.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
    color: white;
}

.hsk-pill.hsk1-pill .beginner-badge {
    font-size: 0.65rem;
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Séparateur vertical entre HSK et Catégories */
.filters-separator {
    width: 1px;
    height: 28px;
    background: var(--border-color, #ddd);
    margin: 0 0.5rem;
}

/* ===== DROPDOWN CATÉGORIES ===== */
.categories-dropdown-wrapper {
    position: relative;
}

.categories-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
}

.categories-dropdown-trigger:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

.categories-dropdown-trigger.has-selection {
    border-color: var(--primary-color, #667eea);
    background: var(--selected-background, #f0f4ff);
}

.categories-dropdown-trigger .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.categories-dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Badge compteur de sélection */
.selection-count {
    background: var(--primary-color, #667eea);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Menu dropdown */
.categories-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    max-height: 350px;
    overflow-y: auto;
    background: var(--background-color, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.categories-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--card-background, #f8f9fa);
    border-radius: 12px 12px 0 0;
}

.dropdown-header span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.btn-clear-categories {
    font-size: 0.75rem;
    color: var(--primary-color, #667eea);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.btn-clear-categories:hover {
    background: var(--hover-background, #f0f4ff);
}

/* Liste des catégories */
.dropdown-categories-list {
    padding: 0.5rem 0;
}

/* Catégorie principale (parent) */
.category-item {
    padding: 0;
}

.category-main {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.category-main:hover {
    background: var(--hover-background, #f5f5f5);
}

.category-main input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.category-main .category-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.category-main .category-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.category-main .expand-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary, #999);
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.category-item.expanded .expand-arrow {
    transform: rotate(90deg);
}

/* Sous-catégories (enfants) */
.subcategories-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--card-background, #fafafa);
}

.category-item.expanded .subcategories-list {
    max-height: 500px; /* Assez grand pour contenir les sous-cats */
}

.subcategory-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.subcategory-item:hover {
    background: var(--hover-background, #f0f0f0);
}

.subcategory-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.subcategory-item .subcat-score {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-tertiary, #999);
    background: var(--background-color, #eee);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ===== BOUTON RESET ===== */
.btn-reset-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-secondary, #666);
    margin-left: auto; /* Pousse à droite */
}

.btn-reset-compact:hover {
    background: var(--hover-background, #f5f5f5);
    color: var(--text-color, #333);
}

/* ===== COMPTEUR DE PACKS ===== */
.packs-count-compact {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.packs-count-compact .count-number {
    font-weight: 600;
    color: var(--primary-color, #667eea);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .filters-bar-compact {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .hsk-pills-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filters-separator {
        display: none;
    }
    
    .categories-dropdown-wrapper {
        width: 100%;
    }
    
    .categories-dropdown-trigger {
        width: 100%;
        justify-content: center;
    }
    
    .categories-dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .btn-reset-compact {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* ===== THÈME SOMBRE ===== */
/* Dark theme */
[data-theme="dark"] .hsk1-pack-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .pack-title {
    color: #f1f5f9;
}

[data-theme="dark"] .pack-description {
    color: #94a3b8;
}

[data-theme="dark"] .tag-mini {
    background: #334155;
    color: #cbd5e1;
}


[data-theme="dark"] .filters-bar-compact {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .hsk-pill {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .hsk-pill:hover {
    background: #475569;
}

[data-theme="dark"] .hsk-pill.active {
    background: var(--primary-color, #667eea);
}

[data-theme="dark"] .categories-dropdown-trigger {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .categories-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-header {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .category-main:hover,
[data-theme="dark"] .subcategory-item:hover {
    background: #334155;
}

[data-theme="dark"] .subcategories-list {
    background: #0f172a;
}

[data-theme="dark"] .filters-bar-compact {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .hsk-pill {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .hsk-pill:hover {
    background: #475569;
}

[data-theme="dark"] .hsk-pill.active {
    background: var(--primary-color, #667eea);
}

[data-theme="dark"] .categories-dropdown-trigger {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .categories-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-header {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .category-main:hover,
[data-theme="dark"] .subcategory-item:hover {
    background: #334155;
}

[data-theme="dark"] .subcategories-list {
    background: #0f172a;
}

/* ===== ICÔNES CATÉGORIES SÉLECTIONNÉES ===== */
.selected-categories-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    background: var(--selected-background, #f0f4ff);
    border-radius: 8px;
    border: 1px solid var(--primary-color, #667eea);
}

.selected-categories-icons .filter-label {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    font-weight: 500;
}

.selected-cat-icon {
    font-size: 1.1rem;
    cursor: default;
    transition: transform 0.2s;
}

.selected-cat-icon:hover {
    transform: scale(1.2);
}

.btn-clear-filters-mini {
    background: none;
    border: none;
    color: var(--text-muted, #999);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.btn-clear-filters-mini:hover {
    color: var(--danger-color, #e53e3e);
}

/* Adaptation du compteur de packs pour inclure les icônes */
.packs-count-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted, #666);
}

/* Dark theme */
[data-theme="dark"] .selected-categories-icons {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

[data-theme="dark"] .selected-categories-icons .filter-label {
    color: #a0aec0;
}

[data-theme="dark"] .btn-clear-filters-mini {
    color: #718096;
}

[data-theme="dark"] .btn-clear-filters-mini:hover {
    color: #fc8181;
}

/* ============================================================================
   FILTRES COMPACTS - Barre horizontale
   Remplace l'ancien .filters-bar vertical
   ============================================================================ */

/* Container principal des filtres - HORIZONTAL */
.filters-bar-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-background, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}

/* ===== GROUPE HSK - Pills toggleables ===== */
.hsk-pills-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hsk-pills-group .group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
}

/* Pills HSK individuelles */
.hsk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
    user-select: none;
}

.hsk-pill:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

/* État actif (sélectionné) */
.hsk-pill.active {
    background: var(--primary-color, #667eea);
    border-color: var(--primary-color, #667eea);
    color: white;
}

/* HSK1 avec style spécial "débutant" */
.hsk-pill.hsk1-pill {
    border-color: #06b6d4;
    color: #06b6d4;
}

.hsk-pill.hsk1-pill.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
    color: white;
}

.hsk-pill.hsk1-pill .beginner-badge {
    font-size: 0.65rem;
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Séparateur vertical entre HSK et Catégories */
.filters-separator {
    width: 1px;
    height: 28px;
    background: var(--border-color, #ddd);
    margin: 0 0.5rem;
}

/* ===== DROPDOWN CATÉGORIES ===== */
.categories-dropdown-wrapper {
    position: relative;
}

.categories-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-color, #333);
}

.categories-dropdown-trigger:hover {
    border-color: var(--primary-color, #667eea);
    background: var(--hover-background, #f0f4ff);
}

.categories-dropdown-trigger.has-selection {
    border-color: var(--primary-color, #667eea);
    background: var(--selected-background, #f0f4ff);
}

.categories-dropdown-trigger .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.categories-dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Badge compteur de sélection */
.selection-count {
    background: var(--primary-color, #667eea);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Menu dropdown */
.categories-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    max-height: 350px;
    overflow-y: auto;
    background: var(--background-color, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.categories-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--card-background, #f8f9fa);
    border-radius: 12px 12px 0 0;
}

.dropdown-header span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.btn-clear-categories {
    font-size: 0.75rem;
    color: var(--primary-color, #667eea);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.btn-clear-categories:hover {
    background: var(--hover-background, #f0f4ff);
}

/* Liste des catégories */
.dropdown-categories-list {
    padding: 0.5rem 0;
}

/* Catégorie principale (parent) */
.category-item {
    padding: 0;
}

.category-main {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.category-main:hover {
    background: var(--hover-background, #f5f5f5);
}

.category-main input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.category-main .category-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.category-main .category-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.category-main .expand-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary, #999);
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.category-item.expanded .expand-arrow {
    transform: rotate(90deg);
}

/* Sous-catégories (enfants) */
.subcategories-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--card-background, #fafafa);
}

.category-item.expanded .subcategories-list {
    max-height: 500px; /* Assez grand pour contenir les sous-cats */
}

.subcategory-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.subcategory-item:hover {
    background: var(--hover-background, #f0f0f0);
}

.subcategory-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.subcategory-item .subcat-score {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-tertiary, #999);
    background: var(--background-color, #eee);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ===== BOUTON RESET ===== */
.btn-reset-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color, #ddd);
    background: var(--background-color, white);
    color: var(--text-secondary, #666);
    margin-left: auto; /* Pousse à droite */
}

.btn-reset-compact:hover {
    background: var(--hover-background, #f5f5f5);
    color: var(--text-color, #333);
}

/* ===== COMPTEUR DE PACKS ===== */
.packs-count-compact {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.packs-count-compact .count-number {
    font-weight: 600;
    color: var(--primary-color, #667eea);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .filters-bar-compact {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .hsk-pills-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filters-separator {
        display: none;
    }
    
    .categories-dropdown-wrapper {
        width: 100%;
    }
    
    .categories-dropdown-trigger {
        width: 100%;
        justify-content: center;
    }
    
    .categories-dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .btn-reset-compact {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* ===== THÈME SOMBRE ===== */
[data-theme="dark"] .filters-bar-compact {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .hsk-pill {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .hsk-pill:hover {
    background: #475569;
}

[data-theme="dark"] .hsk-pill.active {
    background: var(--primary-color, #667eea);
}

[data-theme="dark"] .categories-dropdown-trigger {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .categories-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-header {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .category-main:hover,
[data-theme="dark"] .subcategory-item:hover {
    background: #334155;
}

[data-theme="dark"] .subcategories-list {
    background: #0f172a;
}

/* ===== ICÔNES CATÉGORIES SÉLECTIONNÉES ===== */
.selected-categories-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    background: var(--selected-background, #f0f4ff);
    border-radius: 8px;
    border: 1px solid var(--primary-color, #667eea);
}

.selected-categories-icons .filter-label {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    font-weight: 500;
}

.selected-cat-icon {
    font-size: 1.1rem;
    cursor: default;
    transition: transform 0.2s;
}

.selected-cat-icon:hover {
    transform: scale(1.2);
}

.btn-clear-filters-mini {
    background: none;
    border: none;
    color: var(--text-muted, #999);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.btn-clear-filters-mini:hover {
    color: var(--danger-color, #e53e3e);
}

/* Labels sous-catégories sélectionnées */
.filter-separator {
    color: var(--text-muted, #999);
    margin: 0 0.25rem;
}

.selected-subcat-label {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--tag-background, #e2e8f0);
    color: var(--text-color, #333);
    border-radius: 4px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-subcat-more {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    font-weight: 500;
}



/* Adaptation du compteur de packs pour inclure les icônes */
.packs-count-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted, #666);
}



/* ===== SOUS-CATÉGORIES DANS LES CARDS ===== */
.pack-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.subcategory-mini {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    background: var(--tag-background, #f1f5f9);
    color: var(--tag-color, #64748b);
    border-radius: 4px;
    border: 1px solid var(--tag-border, #e2e8f0);
}

.subcategory-mini:hover {
    background: var(--tag-hover-background, #e2e8f0);
}


/* ===== GRILLE CARDS COMPACTES ===== */
.packs-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

@media (min-width: 900px) {
    .packs-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .packs-grid-compact {
        grid-template-columns: 1fr;
    }
}


/* ===== CARD COMPACTE ===== */
.pack-card-compact {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pack-card-compact:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.pack-card-compact.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}


/* Top row: HSK + Status + Recommend */
.card-top-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.card-hsk {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}
/* ===== BADGES STATUT ===== */
.card-status {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.card-status.status-new {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.card-status.status-discover {
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    color: #312e81;
}

.card-status.status-progress {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
    color: #064e3b;
}

.card-status.status-completed {
    background: linear-gradient(135deg, #86efac, #4ade80);
    color: #14532d;
}

.card-recommend {
    margin-left: auto;
    font-size: 1rem;
}

/* Titre card */
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pack-card-compact.selected .card-title {
    color: #bdbcd6;  /* Indigo clair */
    font-weight: 800;
}


/* Catégories et sous-catégories */
.card-categories {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Card sélectionnée - catégories et sous-catégories */
.pack-card-compact.selected .card-cat-icons {
    filter: brightness(0.9);  /* Légèrement plus sombre */
}

.pack-card-compact.selected .subcat-pill {
    background: rgba(49, 46, 129, 0.2);  /* Fond indigo */
    color: #bdbcd6;  /* Texte indigo foncé */
}

.pack-card-compact.selected .card-meta {
    color: #bdbcd6;  /* Meta en indigo */
}

.card-cat-icons {
    font-size: 1.1rem;
    letter-spacing: 3px;
}

.subcat-pill {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Meta info */
.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* ===== MODAL DÉTAIL PACK ===== */
.pack-detail-modal {
    z-index: 1100;
}

.pack-detail-modal .modal-content,
.modal-detail-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--background-card, rgba(255, 255, 255, 0.95));
    border-radius: 16px;
    color: var(--text-color, #1e293b);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}


/* Thème par défaut / colorful */
[data-theme="default"] .modal-detail-content,
[data-theme="colorful"] .modal-detail-content {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%
    ), rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Thème sombre */
[data-theme="dark"] .modal-detail-content {
    background: var(--background-card, #1e293b);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Thème clair */
[data-theme="light"] .modal-detail-content {
    background: var(--background-card, #ffffff);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

/* Thème minimal */
[data-theme="minimal"] .modal-detail-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
}


/* Navigation */
.detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #475569;
    transition: all 0.2s;
}

.nav-btn:hover:not(.disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-counter {
    font-size: 0.85rem;
    color: #64748b;
}

/* Header modal */
.detail-header {
    margin-bottom: 1rem;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    flex: 1;
}

.detail-hsk {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.detail-status {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.detail-status.status-new {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.detail-status.status-discover {
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    color: #312e81;
}

.detail-status.status-progress {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
    color: #064e3b;
}

.detail-status.status-completed {
    background: linear-gradient(135deg, #86efac, #4ade80);
    color: #14532d;
}

/* Description */
.detail-description {
    color: #475569;
    line-height: 1.6;
    margin: 1rem 0;
}

/* Meta info */
.detail-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #475569;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Recommandation */
.detail-recommend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #92400e;
    font-weight: 500;
}

.recommend-icon {
    font-size: 1.2rem;
}

/* Progression */
.detail-progress {
    background: linear-gradient(135deg, rgba(209, 250, 229, 0.8), rgba(167, 243, 208, 0.8));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 1rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #065f46;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-time {
    font-size: 0.8rem;
    color: #047857;
    margin-top: 0.5rem;
}

/* Section catégories */
.detail-categories-section {
    margin: 1.5rem 0;
}

.detail-categories-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-weight: 600;
}

.detail-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-category {
    background: rgba(241, 245, 249, 0.9);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-cat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-cat-icon {
    font-size: 1.2rem;
}

.detail-cat-label {
    color: #1e293b;
}

.detail-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: 1.75rem;
}

.detail-subcat {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    color: #475569;
}

/* Actions */
.detail-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.btn-select-pack-detail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-select-pack-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}


/* ========================================
   THÈMES ALTERNATIFS
   ======================================== */
body[data-theme="dark"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
}

body[data-theme="dark"] .main-content,
body[data-theme="dark"] .themes-panel,
body[data-theme="dark"] .language-panel {
    background: rgba(0, 0, 0, 0.5);
}

body[data-theme="colorful"] {
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #FFE66D 100%);
}

body[data-theme="minimal"] {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    color: #333;
}

body[data-theme="minimal"] .main-content,
body[data-theme="minimal"] .themes-panel,
body[data-theme="minimal"] .language-panel {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body[data-theme="minimal"] .theme-option,
body[data-theme="minimal"] .language-option {
    color: #333;
    border-color: rgba(0, 0, 0, 0.2);
}

/* ===== THÈME SOMBRE - Adaptations ===== */
[data-theme="dark"] .mode-desc {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

[data-theme="dark"] .desc-content h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .desc-content p {
    color: #94a3b8;
}

[data-theme="dark"] .desc-badge {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .hsk-filters-container {
    background: #1e293b;
}

[data-theme="dark"] .hsk-vertical-separator {
    background: linear-gradient(180deg, transparent, #475569, transparent);
}

[data-theme="dark"] .hsk-vertical-separator::after {
    background: #1e293b;
    color: #64748b;
}

[data-theme="dark"] .level-badge-mini {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .hsk1-checkbox input:checked ~ .hsk1-label .level-badge-mini {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}


[data-theme="dark"] .beginner-mode-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #3b82f6;
}

[data-theme="dark"] .mode-description {
    color: #94a3b8;
}

[data-theme="dark"] .feature-badge {
    background: #1e293b;
    color: #38bdf8;
    border-color: #334155;
}

[data-theme="dark"] .level-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .level-card:hover {
    border-color: #38bdf8;
}

[data-theme="dark"] .level-number {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #e5e7eb;
}

[data-theme="dark"] .level-card h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .level-card p {
    color: #94a3b8;
}



/* Dark theme */
[data-theme="dark"] .subcategory-mini {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

[data-theme="dark"] .subcategory-mini:hover {
    background: #475569;
}

[data-theme="dark"] .pack-card-compact:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

[data-theme="dark"] .subcat-pill {
    background: #334155;
    color: #cbd5e1;
}

/* Dark theme */
[data-theme="dark"] .filter-separator {
    color: #64748b;
}

[data-theme="dark"] .selected-subcat-label {
    background: #334155;
    color: #e2e8f0;
}

/* Dark theme */
[data-theme="dark"] .selected-categories-icons {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

[data-theme="dark"] .selected-categories-icons .filter-label {
    color: #a0aec0;
}

[data-theme="dark"] .btn-clear-filters-mini {
    color: #718096;
}

[data-theme="dark"] .btn-clear-filters-mini:hover {
    color: #fc8181;
}

/* Dark theme modal */
[data-theme="dark"] .modal-detail-content {
    background: #1e293b;
}

[data-theme="dark"] .detail-nav {
    border-color: #334155;
}

[data-theme="dark"] .nav-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .detail-title {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-description {
    color: #cbd5e1;
}

[data-theme="dark"] .detail-meta {
    background: #0f172a;
}

[data-theme="dark"] .detail-recommend {
    background: #422006;
    color: #fcd34d;
}

[data-theme="dark"] .detail-progress {
    background: #064e3b;
    border-color: #065f46;
}

[data-theme="dark"] .detail-category {
    background: #0f172a;
}

[data-theme="dark"] .detail-cat-label {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-subcat {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .detail-actions {
    border-color: #334155;
}


/* ============================================================================
   THÈME SOMBRE - Cards & Modal
   ============================================================================ */

[data-theme="dark"] .pack-card-compact {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}


[data-theme="dark"] .pack-card-compact:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
	border-color: #334155;
}

[data-theme="dark"] .pack-card-compact.selected {
    background: rgba(155, 199, 208, 0.8);
    border-color: #818cf8;
}

[data-theme="dark"] .card-title {
    color: #f1f5f9;
}

[data-theme="dark"] .pack-card-compact.selected .card-title {
    color: #e0e7ff;
}

[data-theme="dark"] .subcat-pill {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

[data-theme="dark"] .card-meta {
    color: #94a3b8;
}

/* Modal dark */
[data-theme="dark"] .pack-detail-modal .modal-content,
[data-theme="dark"] .modal-detail-content {
    background: rgba(30, 41, 59, 0.98);
    color: #e2e8f0;
}

[data-theme="dark"] .detail-nav {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .nav-btn:hover:not(.disabled) {
    background: #818cf8;
    border-color: #818cf8;
}

[data-theme="dark"] .nav-counter {
    color: #94a3b8;
}

[data-theme="dark"] .detail-title {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-description {
    color: #cbd5e1;
}

[data-theme="dark"] .detail-meta {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

[data-theme="dark"] .detail-recommend {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.4), rgba(146, 64, 14, 0.4));
    color: #fcd34d;
}

[data-theme="dark"] .detail-progress {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.6), rgba(4, 120, 87, 0.6));
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .progress-header {
    color: #6ee7b7;
}

[data-theme="dark"] .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .progress-time {
    color: #34d399;
}

[data-theme="dark"] .detail-categories-section h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-category {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .detail-cat-label {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-subcat {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

[data-theme="dark"] .detail-actions {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   THÈME COLORÉ - Cards & Modal
   ============================================================================ */

[data-theme="colorful"] .pack-card-compact {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 244, 255, 0.95));
    border-color: rgba(102, 126, 234, 0.2);
}

[data-theme="colorful"] .pack-card-compact:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

[data-theme="colorful"] .modal-detail-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 244, 255, 0.98));
}

/* ============================================================================
   THÈME MINIMAL - Cards & Modal
   ============================================================================ */

[data-theme="minimal"] .pack-card-compact {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

[data-theme="minimal"] .pack-card-compact:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="minimal"] .card-hsk {
    background: #374151;
}

[data-theme="minimal"] .card-status {
    background: #f3f4f6;
    color: #374151;
}

[data-theme="minimal"] .modal-detail-content {
    background: #ffffff;
    border-radius: 8px;
}

[data-theme="minimal"] .detail-hsk {
    background: #374151;
}

[data-theme="minimal"] .detail-status {
    background: #f3f4f6;
    color: #374151;
}


/* ============================================================================
   PROFIL UTILISATEUR - MÉTRIQUES RÉTENTION & COUVERTURE
   Ajouter à index.css
   ============================================================================ */

/* Item de force/faiblesse */
.strength-item,
.weakness-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.strength-item {
    border-left: 3px solid #10b981;
}

.weakness-item {
    border-left: 3px solid #f59e0b;
}

/* Label avec icône */
.item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.item-label span:first-child {
    font-size: 1.2rem;
}

/* Stats (X / Y mots) */
.item-stats {
    margin-bottom: 8px;
}

.stat-known {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Container des métriques */
.item-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Ligne métrique (label + valeur) */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.metric-label {
    color: rgba(255, 255, 255, 0.6);
}

.metric-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Barres de progression */
.item-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.item-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Barre rétention - vert */
.item-progress.retention .item-progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Barre couverture - bleu */
.item-progress.coverage .item-progress-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}


/* ============================================================================
   THÈME CLAIR
   ============================================================================ */

[data-theme="light"] .strength-item,
[data-theme="light"] .weakness-item,
[data-theme="minimal"] .strength-item,
[data-theme="minimal"] .weakness-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .item-label,
[data-theme="minimal"] .item-label {
    color: #1e293b;
}

[data-theme="light"] .stat-known,
[data-theme="minimal"] .stat-known {
    color: #475569;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .metric-label,
[data-theme="minimal"] .metric-label {
    color: #64748b;
}

[data-theme="light"] .metric-value,
[data-theme="minimal"] .metric-value {
    color: #1e293b;
}

[data-theme="light"] .item-progress,
[data-theme="minimal"] .item-progress {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   THÈME SOMBRE
   ============================================================================ */

[data-theme="dark"] .strength-item,
[data-theme="dark"] .weakness-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .item-label {
    color: #f1f5f9;
}

[data-theme="dark"] .stat-known {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .metric-label {
    color: #94a3b8;
}

[data-theme="dark"] .metric-value {
    color: #e2e8f0;
}

[data-theme="dark"] .item-progress {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   THÈME COLORÉ
   ============================================================================ */

[data-theme="colorful"] .strength-item {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    border-left-color: #10b981;
}

[data-theme="colorful"] .weakness-item {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    border-left-color: #f59e0b;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .item-metrics {
        gap: 3px;
    }
    
    .metric-row {
        font-size: 0.7rem;
    }
    
    .item-progress {
        height: 5px;
        margin-bottom: 4px;
    }
}


/* ============================================================================
   PROFIL UTILISATEUR - MÉTRIQUES RÉTENTION & COUVERTURE
   Ajouter à index.css
   ============================================================================ */

/* Item de force/faiblesse */
.strength-item,
.weakness-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.strength-item {
    border-left: 3px solid #10b981;
}

.weakness-item {
    border-left: 3px solid #f59e0b;
}

/* Header : label + ratio sur même ligne */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Label avec icône */
.item-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.item-label span:first-child {
    font-size: 1.1rem;
}

/* Stats (X/Y) */
.stat-known {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Container des métriques */
.item-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Ligne métrique (label + barre + valeur) */
.metric-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
}

.metric-label {
    color: rgba(255, 255, 255, 0.6);
    width: 65px;
    flex-shrink: 0;
}

.metric-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    width: 35px;
    text-align: right;
    flex-shrink: 0;
}

/* Barres de progression */
.item-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.item-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Barre rétention - vert */
.item-progress.retention .item-progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Barre couverture - bleu */
.item-progress.coverage .item-progress-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* ============================================================================
   THÈME CLAIR
   ============================================================================ */

[data-theme="light"] .strength-item,
[data-theme="light"] .weakness-item,
[data-theme="minimal"] .strength-item,
[data-theme="minimal"] .weakness-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .item-label,
[data-theme="minimal"] .item-label {
    color: #1e293b;
}

[data-theme="light"] .stat-known,
[data-theme="minimal"] .stat-known {
    color: #475569;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .metric-label,
[data-theme="minimal"] .metric-label {
    color: #64748b;
}

[data-theme="light"] .metric-value,
[data-theme="minimal"] .metric-value {
    color: #1e293b;
}

[data-theme="light"] .item-progress,
[data-theme="minimal"] .item-progress {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   THÈME SOMBRE
   ============================================================================ */

[data-theme="dark"] .strength-item,
[data-theme="dark"] .weakness-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .item-label {
    color: #f1f5f9;
}

[data-theme="dark"] .stat-known {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .metric-label {
    color: #94a3b8;
}

[data-theme="dark"] .metric-value {
    color: #e2e8f0;
}

[data-theme="dark"] .item-progress {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   THÈME COLORÉ
   ============================================================================ */

[data-theme="colorful"] .strength-item {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    border-left-color: #10b981;
}

[data-theme="colorful"] .weakness-item {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    border-left-color: #f59e0b;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .metric-label {
        width: 55px;
        font-size: 0.65rem;
    }
    
    .metric-value {
        width: 30px;
        font-size: 0.65rem;
    }
    
    .item-progress {
        height: 5px;
    }
}


/* Éléments internes adaptés au thème */
.detail-meta,
.detail-category {
    background: var(--background-secondary, rgba(0, 0, 0, 0.03));
}

[data-theme="dark"] .detail-meta,
[data-theme="dark"] .detail-category {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="default"] .detail-meta,
[data-theme="default"] .detail-category,
[data-theme="colorful"] .detail-meta,
[data-theme="colorful"] .detail-category {
    background: rgba(255, 255, 255, 0.5);
}


/* ============================================
   STYLES POUR LA SECTION HISTOIRES RÉCENTES
   À ajouter dans index.css
   ============================================ */

/* ========================================
   SECTION CONTAINER
   ======================================== */

.recent-stories-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg, #7895b3);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e9ecef);
	width: 500px;
	text-align: left;
}

.recent-stories-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #333);
    display: flex;
    align-items: left;
    gap: 0.5rem;
	text-align: left;
    justify-content: flex-start;
}


.recent-stories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========================================
   ITEM D'HISTOIRE RÉCENTE
   ======================================== */

.recent-story-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
	gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--item-bg, #2c5178);
    border-radius: 8px;
    border: 1px solid var(--border-light, #dee2e6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-story-item:hover {
    background: var(--item-hover-bg, #699ad1);
    border-color: var(--primary-color, #4a90d9);
    transform: translateX(4px);
}


.recent-story-item.completed {
    opacity: 0.7;
    background: var(--completed-bg, #f0f9f0);
}

.recent-story-item.completed::before {
    content: '✓';
    position: absolute;
    left: 0.5rem;
    color: var(--success-color, #28a745);
    font-weight: bold;
}

/* ========================================
   INFOS DE L'HISTOIRE
   ======================================== */

.recent-story-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;  /* Permet le text-overflow */
}

.recent-story-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	align-items: left;
}

.recent-story-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

.recent-progress {
    font-weight: 500;
    color: var(--primary-color, #4a90d9);
}

.recent-separator {
    color: var(--text-muted, #adb5bd);
}

.recent-time {
    font-style: italic;
}

/* ========================================
   BOUTON PLAY
   ======================================== */
.recent-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 4px;
    border: none;
    background: transparent;
    border-radius: 30%;        /* ← Cercle au lieu de 8px */
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.recent-play-btn:hover {
    background: rgba(74, 144, 217, 0.1);
    transform: scale(1.1);
}

.recent-play-btn .icon-audiobook {
    width: 36px;
    height: 36px;
	justify-content: right;
    /* Pas de filtre - garder les couleurs originales */
}

/* ========================================
   ICÔNES DANS LES BOUTONS PRINCIPAUX
   ======================================== */

.btn-icon-img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Bouton Commencer avec icône */
.btn-primary .btn-icon-img {
    filter: brightness(0) invert(1);  /* Icône blanche sur fond coloré */
}

/* Bouton Choisir un Pack */
.btn-secondary .btn-icon-img {
    filter: none;  /* Garder les couleurs originales */
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
    .recent-stories-section {
        padding: 0.75rem;
    }
    
    .recent-story-item {
        padding: 0.5rem 0.75rem;
    }
    
    .recent-story-title {
        font-size: 0.9rem;
    }
    
    .recent-play-btn {
        width: 36px;
        height: 36px;
    }
    
    .recent-play-btn .icon-audiobook {
        width: 18px;
        height: 18px;
    }
}

/* ========================================
   THÈMES (compatibilité avec themes.css)
   ======================================== */

[data-theme="dark"] .recent-stories-section {
    background: var(--card-bg, #2d3748);
    border-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .recent-story-item {
    background: var(--item-bg, #1a202c);
    border-color: var(--border-light, #4a5568);
}

[data-theme="dark"] .recent-story-item:hover {
    background: var(--item-hover-bg, #2d3748);
}

[data-theme="dark"] .recent-story-title {
    color: var(--text-color, #e2e8f0);
}

[data-theme="dark"] .recent-story-meta {
    color: var(--text-muted, #a0aec0);
}

[data-theme="minimal"] .recent-stories-section {
    background: transparent;
    border: 1px dashed var(--border-color, #ccc);
}

[data-theme="minimal"] .recent-story-item {
    background: transparent;
    border: 1px solid var(--border-light, #ddd);
}


/* ========================================
   HIGHLIGHT ET ANIMATION PULSE
   ======================================== */

/* Item mis en évidence */
.recent-story-item.highlighted {
    background: var(--highlight-bg, #aecff2);
    border-color: var(--primary-color, #4a90d9);
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* Texte mis en évidence */
.recent-story-item.highlighted .recent-story-title {
    color: var(--primary-color, #4e6985	);
    font-weight: 700;
}

.recent-story-item.highlighted .recent-progress {
    color: var(--primary-dark, #357abd);
    font-weight: 600;
}

.recent-story-item.highlighted .recent-time {
    color: var(--primary-color, #4a90d9);
    font-style: normal;
    font-weight: 500;
}

/* Transition sur les textes */
.recent-story-title,
.recent-progress,
.recent-time {
    transition: color 0.2s ease, font-weight 0.2s ease;
}

/* Hover */
.recent-story-item:hover .recent-story-title {
    color:#debd26;  /*var(--primary-color, #4a90d9);*/
    font-weight: 700;
}

.recent-story-item:hover .recent-progress {
    color:#debd26; /*var(--primary-dark, #357abd);*/
}

.recent-story-item:hover .recent-time {
    color:#debd26; /*var(--primary-color, #4a90d9);*/
}

.recent-story-item.highlighted:hover .recent-story-title {
    color:#ab6c15; /*var(--primary-color, #4a90d9);*/
}

.recent-story-item.highlighted:hover .recent-progress {
    color:#494c63; /*var(--primary-color, #4a90d9);*/
}

.recent-story-item.highlighted:hover .recent-time {
    color:#494c63; /*var(--primary-color, #4a90d9);*/
}


/* Animation pulse sur le bouton */
.recent-story-item.highlighted .recent-play-btn {
    animation: pulse-play 1s ease-in-out infinite;
}

@keyframes pulse-play {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(145, 29, 214, 0.7);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 12px 10px rgba(145, 29, 191, 0.3);
    }
}

/* Thème dark */
[data-theme="dark"] .recent-story-item.highlighted {
    background: var(--highlight-bg, #2a4a6a);
    border-color: var(--primary-color, #5a9fd9);
}

[data-theme="dark"] .recent-story-item.highlighted .recent-story-title {
    color: var(--primary-light, #7ab8f5);
}

[data-theme="dark"] .recent-story-item.highlighted .recent-progress,
[data-theme="dark"] .recent-story-item.highlighted .recent-time {
    color: var(--primary-light, #7ab8f5);
}

/* ========================================
   CHAMP DE RECHERCHE PACKS
   ======================================== */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 12px;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4ECDC4;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.search-icon {
    font-size: 0.9rem;
    margin-right: 8px;
    opacity: 0.7;
}

.pack-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 0.9rem;
    width: 100%;
}

.pack-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-clear-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Thème jour */
[data-theme="day"] .search-input-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="day"] .pack-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="day"] .search-clear-btn {
    color: rgba(0, 0, 0, 0.5);
}


@media (max-width: 768px) {
    
    /* Modal pack browser - layout vertical */
    .pack-browser-layout {
        flex-direction: column;
    }
    
    /* Liste des packs prend toute la largeur */
    .packs-section {
        width: 100%;
        order: 1;  /* Packs en premier */
    }
    
    /* Forces/Faiblesses en dessous ou masqué */
    .user-profile-section {
        width: 100%;
        order: 2;  /* Après les packs */
        /* OU masquer complètement sur mobile : */
        /* display: none; */
    }
    
    /* Modal prend tout l'écran */
    .modal-content-large {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Filtres HSK - scroll horizontal si besoin */
    .hsk-pills-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
}/* ============================================================================
   CHRONICLE - CORRECTIONS MOBILE (index_mobile_fixes.css)
   À ajouter à la fin de index.css ou importer après
   ============================================================================ */

/* ============================================================================
   BREAKPOINT TABLETTE (< 1024px) - Layout 2 colonnes puis 1
   ============================================================================ */

@media (max-width: 1024px) {
    
    /* Layout principal - passe en colonne unique */
    .main-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px;
        padding: 15px;
        min-height: auto;
    }
    
    /* Réorganiser l'ordre des éléments */
    .main-content {
        order: 1;  /* Contenu principal en premier */
        width: 100%;
    }
    
    .themes-panel {
        order: 3;  /* Thèmes après le contenu */
        width: 100%;
    }
    
    .right-column {
        order: 2;  /* Langue/Auth après contenu, avant thèmes */
        width: 100%;
    }
    
    .help-panel {
        order: 4;  /* Aide en dernier */
        width: 100%;
    }
    
    /* Panneaux latéraux en mode horizontal compact */
    .themes-panel,
    .language-panel {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .themes-panel h3,
    .language-panel h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        font-size: 0.95rem;
    }
    
    .theme-option,
    .language-option {
        flex: 0 1 auto;
        min-width: 100px;
        padding: 8px 15px;
        margin: 0;
        font-size: 0.85rem;
    }
    
    /* Right column en horizontal */
    .right-column {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        align-items: stretch;
    }
    
    .language-panel,
    .auth-status-panel {
        flex: 1 1 200px;
        max-width: 300px;
    }
    
    /* Cacher les éléments moins importants sur tablette */
    .sidebar-bottom {
        display: none;
    }
    
    .user-welcome {
        display: none !important;
    }
}

/* ============================================================================
   BREAKPOINT MOBILE (< 768px) - Optimisation téléphone
   ============================================================================ */

@media (max-width: 768px) {
    
    /* Layout encore plus compact */
    .main-layout {
        padding: 10px;
        gap: 12px;
    }
    
    /* Contenu principal */
    .main-content {
        padding: 15px;
        border-radius: 15px;
    }
    
    /* Logo réduit */
    .app-logo {
        height: 120px !important;
        max-width: 100%;
    }
    
    .title-row {
        flex-direction: column !important;
        gap: 0.25rem !important;
    }
    
    .title-row .version-badge {
        margin-top: 5px;
        font-size: 0.65rem;
    }
    
    /* Panneaux latéraux encore plus compacts */
    .themes-panel,
    .language-panel,
    .auth-status-panel {
        padding: 10px;
        border-radius: 10px;
    }
    
    .themes-panel h3,
    .language-panel h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .theme-option,
    .language-option {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    /* Right column empilée sur mobile */
    .right-column {
        flex-direction: column;
        align-items: stretch;
    }
    
    .language-panel,
    .auth-status-panel {
        max-width: 100%;
        flex: 1 1 auto;
    }
    
    /* Auth panel compact */
    #authStatus {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #authStatus button {
        flex: 1 1 120px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Section Flashcards */
    .review-cards-section {
        padding: 0.25rem 0;
    }
    
    .review-title {
        font-size: 1rem;
    }
    
    /* Section histoires récentes */
    .recent-stories-section {
        margin: 10px 0;
    }
    
    .recent-stories-header h3 {
        font-size: 0.95rem;
    }
    
    .recent-story-item {
        padding: 8px 10px;
    }
    
    .recent-story-title {
        font-size: 0.85rem;
    }
    
    .recent-play-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Boutons d'action */
    .buttons-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .buttons-row .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Mode descriptions */
    .modes-descriptions {
        margin-top: 15px;
    }
    
    .mode-desc {
        padding: 12px;
    }
    
    .desc-content h4 {
        font-size: 0.95rem;
    }
    
    .desc-content p {
        font-size: 0.85rem;
    }
    
    .desc-badges {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .desc-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    /* Help panel compact */
    .help-panel {
        padding: 10px;
        max-height: 100px;
    }
    
    .help-panel h4 {
        font-size: 0.9rem;
    }
    
    .help-output {
        font-size: 0.8rem;
    }
    
    /* Info pack sélectionné */
    .selected-pack-info {
        font-size: 0.85rem;
        padding: 8px;
    }
}

/* ============================================================================
   BREAKPOINT PETIT MOBILE (< 480px)
   ============================================================================ */

@media (max-width: 480px) {
    
    .main-layout {
        padding: 8px;
        gap: 10px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .app-logo {
        height: 100px !important;
    }
    
    /* Panneaux en mode minimal */
    .themes-panel,
    .language-panel {
        padding: 8px;
    }
    
    .themes-panel h3,
    .language-panel h3 {
        font-size: 0.85rem;
    }
    
    .theme-option,
    .language-option {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    /* Auth très compact */
    .auth-status-panel {
        padding: 8px;
    }
    
    #authStatus button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .user-stats-mini {
        font-size: 0.75rem;
        gap: 10px;
    }
    
    /* Flashcards carousel réduit */
    .cards-carousel {
        height: 200px;
    }
    
    .carousel-card {
        width: 100px;
        height: 140px;
        margin-left: -50px;
        margin-top: -70px;
    }
    
    .carousel-card .card-count {
        font-size: 1.8rem;
    }
    
    .carousel-card .card-label {
        font-size: 0.6rem;
    }
    
    /* Boutons */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Help panel minimal */
    .help-panel {
        max-height: 80px;
    }
}

/* ============================================================================
   MODAL PACK BROWSER - CORRECTIONS MOBILE
   ============================================================================ */

@media (max-width: 900px) {
    
    /* Modal plein écran */
    .modal-content-large {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    /* Layout en colonne */
    .pack-browser-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        overflow-y: auto;
        height: calc(100vh - 60px);
    }
    
    /* Section packs prend toute la largeur */
    .packs-section {
        width: 100%;
        order: 1;
        flex-shrink: 0;
    }
    
    /* Section profil en dessous */
    .user-profile-section {
        width: 100%;
        order: 2;
        padding-right: 0;
    }
    
    /* Header modal compact */
    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .close-btn {
        font-size: 1.5em;
        top: 10px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    
    /* Filtres compacts */
    .filters-bar-compact {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    /* Recherche pleine largeur */
    .search-input-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    /* HSK pills scrollables */
    .hsk-pills-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .hsk-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .group-label {
        display: none;  /* Cacher le label HSK sur petit écran */
    }
    
    /* Séparateur caché */
    .filters-separator {
        display: none;
    }
    
    /* Dropdown catégories */
    .categories-dropdown-wrapper {
        width: 100%;
    }
    
    .categories-dropdown-trigger {
        width: 100%;
        justify-content: center;
    }
    
    .categories-dropdown-menu {
        width: 100%;
        max-width: none;
    }
    
    /* Reset button */
    .btn-reset-compact {
        width: 100%;
        justify-content: center;
    }
    
    /* Compteur packs */
    .packs-count-compact {
        text-align: center;
        font-size: 0.85rem;
    }
    
    /* Grille packs en colonne */
    .packs-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Cards profil plus compactes */
    .profile-card {
        padding: 1rem;
    }
    
    .profile-card h3 {
        font-size: 1rem;
    }
    
    .strength-item,
    .weakness-item,
    .recommendation-item {
        padding: 0.5rem;
    }
    
    .item-label {
        font-size: 0.85rem;
    }
    
    .item-percentage {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    
    .pack-browser-layout {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1rem;
    }
    
    .hsk-pill {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    /* Option: cacher la section profil sur très petit écran */
    .user-profile-section {
        display: none;  /* Désactiver si vous voulez montrer */
    }
}

/* ============================================================================
   CARROUSEL FLASHCARDS - CORRECTIONS MOBILE
   ============================================================================ */

@media (max-width: 768px) {
    
    .cards-carousel {
        height: 220px;
    }
    
    .carousel-card {
        width: 110px;
        height: 155px;
        margin-left: -55px;
        margin-top: -77px;
    }
    
    .carousel-card.pos-left {
        transform: translateX(-70px) translateZ(-80px) rotateY(20deg) scale(0.8);
    }
    
    .carousel-card.pos-right {
        transform: translateX(70px) translateZ(-80px) rotateY(-20deg) scale(0.8);
    }
    
    .hover-zone {
        width: 40px;  /* Plus large pour tactile */
    }
}

/* ============================================================================
   AMÉLIORATIONS TACTILES
   ============================================================================ */

@media (max-width: 768px) {
    
    /* Zones cliquables plus grandes */
    .theme-option,
    .language-option,
    .btn,
    .pack-card,
    .recent-story-item {
        min-height: 44px;  /* Minimum recommandé pour touch */
    }
    
    /* Pas de hover effects sur mobile (empêche sticky hover) */
    .theme-option:hover,
    .language-option:hover {
        transform: none;
    }
    
    .theme-option:active,
    .language-option:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* ============================================================================
   FIX OVERFLOW ET SCROLL
   ============================================================================ */

@media (max-width: 1024px) {
    
    /* Empêcher overflow horizontal */
    body {
        overflow-x: hidden;
    }
    
    .main-layout {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .main-content {
        overflow-x: hidden;
        word-wrap: break-word;
    }
}

/* ============================================================================
   THÈMES - Ajustements mobile
   ============================================================================ */

@media (max-width: 768px) {
    
    /* Fond plus simple sur mobile pour performance */
    body[data-theme="default"] {
        background-attachment: scroll;  /* Pas de fixed background */
    }
    
    /* Réduire les blurs sur mobile pour performance */
    .main-content,
    .themes-panel,
    .language-panel,
    .auth-status-panel,
    .help-panel {
        backdrop-filter: blur(5px);  /* Réduit de 10px */
    }
}



/* ========================================
   SECTION CONTINUER MON HISTOIRE
   Style "Reprendre" avec expansion
   ============================================ */
.section-continue,
.section-flashcards,
.section-hsk {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
}

.section-header h3,
.section-flashcards h3,
.section-hsk h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.section-icon {
    font-size: 1.2rem;
}

.expand-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

/* ============================================
   CONTAINER STORIES (style Reprendre)
   ============================================ */
.stories-container {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    padding: 15px;
    margin: 0 15px;
}

/* ============================================
   ITEM HISTOIRE (adapté de .recent-story-item)
   ============================================ */
.story-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--item-bg, #2c5178);
    border-radius: 8px;
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.story-item:last-child {
    margin-bottom: 0;
}

.story-item:hover {
    background: var(--item-hover-bg, #699ad1);
    border-color: var(--primary-color, #4a90d9);
    transform: translateX(4px);
}

/* Histoire active - highlight vert */
.story-item.story-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
    border-color: rgba(34, 197, 94, 0.4);
}

.story-item.story-active:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(34, 197, 94, 0.2));
    border-color: rgba(34, 197, 94, 0.6);
}

/* Histoire complétée */
.story-item.story-completed {
    opacity: 0.7;
    background: var(--completed-bg, rgba(240, 249, 240, 0.1));
}

.story-item.story-completed::before {
    content: '✓';
    position: absolute;
    left: 0.5rem;
    color: var(--success-color, #28a745);
    font-weight: bold;
}


/* ============================================
   INFOS HISTOIRE (adapté de .recent-story-info)
   ============================================ */
.story-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;  /* Permet le text-overflow */
}

.story-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.story-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.7));
}

.story-progress {
    font-weight: 500;
    color: var(--primary-color, #4a90d9);
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.story-separator {
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.story-time {
    font-style: italic;
}

/* ============================================
   BOUTON ICÔNE LIVRE (adapté de .recent-play-btn)
   ============================================ */
.story-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 4px;
    border: none;
    background: transparent;
    border-radius: 30%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.story-play-btn:hover {
    background: rgba(74, 144, 217, 0.2);
    transform: scale(1.1);
}

.story-play-btn .icon-audiobook {
    width: 36px;
    height: 36px;
}

/* ============================================
   HISTORIQUE (caché par défaut)
   ============================================ */
.historique-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.historique-list.expanded {
    max-height: 400px;
}

.historique-list .story-item {
    margin-top: 10px;
    margin-bottom: 0;
}

/* ============================================
   SECTION FLASHCARDS - RUBAN AVEC CADRE
   ============================================ */
.section-flashcards h3 {
    padding: 10px 15px;
}

.flashcards-container {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    padding: 15px;
    margin: 0 15px;
}

.flashcards-ribbon-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ribbon-arrow {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.ribbon-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.flashcards-ribbon {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px 0;
    flex: 1;
}

.flashcards-ribbon::-webkit-scrollbar {
    display: none;
}

/* Vignette flashcard */
.flashcard-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 110px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.1));
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    scroll-snap-align: start;
    transition: all 0.2s ease;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.flashcard-thumb:hover {
    transform: scale(1.05);
    border-color: rgba(251, 191, 36, 0.6);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.2));
}

.flashcard-thumb .thumb-count {
    font-size: 2rem;
    font-weight: bold;
    color: #FBBF24;
}

.flashcard-thumb .thumb-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 0 8px;
    margin-top: 5px;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
}

/* Fake card - quand vide ou peu de flashcards */
.flashcard-thumb.flashcard-empty {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px dashed rgba(255, 255, 255, 0.3);
    cursor: default;
}

.flashcard-thumb.flashcard-empty:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.flashcard-thumb.flashcard-empty .thumb-icon {
    font-size: 1.5rem;
    opacity: 0.6;
    margin-bottom: 5px;
}

.flashcard-thumb.flashcard-empty .thumb-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 0 8px;
    line-height: 1.3;
}

/* ============================================
   SECTION HSK
   ============================================ */
.section-hsk h3 {
    padding: 10px 15px;
}

.hsk-cards-row {
    display: flex;
    gap: 15px;
    padding: 0 15px 10px 15px;
    justify-content: center;
}

.hsk-card {
    flex: 1;
    max-width: 150px;
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.3), rgba(100, 149, 237, 0.1));
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(100, 149, 237, 0.3);
}

.hsk-card:hover {
    transform: translateY(-3px);
    border-color: rgba(100, 149, 237, 0.6);
    box-shadow: 0 5px 20px rgba(100, 149, 237, 0.2);
}

.hsk-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
}

.hsk-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.hsk-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .section-continue,
    .section-flashcards,
    .section-hsk {
        max-width: 100%;
    }
    
    .stories-container,
    .flashcards-container {
        margin: 0 10px;
    }
    
    .story-item {
        padding: 0.6rem 0.8rem;
    }
    
    .story-play-btn {
        width: 40px;
        height: 40px;
    }
    
    .story-play-btn .icon-audiobook {
        width: 32px;
        height: 32px;
    }
    
    .flashcard-thumb {
        width: 90px;
        height: 100px;
    }
    
    .flashcard-thumb .thumb-count {
        font-size: 1.6rem;
    }
    
    .hsk-cards-row {
        gap: 10px;
        padding: 0 10px 10px 10px;
    }
    
    .hsk-card {
        padding: 15px 10px;
    }
}


/* ============================================
   AJUSTER LE LAYOUT PRINCIPAL
   ============================================ */

/* Plus de grid 3 colonnes - juste centré */
.main-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: 70px;  /* Espace pour la top-bar */
}

/* Main content centré et plus large */
.main-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Élargir les sections */
.section-continue,
.section-flashcards,
.section-hsk {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 12px auto;
}

/* Bouton tutorial en bas */
.tutorial-button-container {
    margin-top: 20px;
    text-align: center;
}

.sidebar-tutorial-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color, #333);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Help panel repositionné */
.help-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-card, rgba(255, 255, 255, 0.95));
    padding: 10px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    max-height: 100px;
    overflow-y: auto;
    z-index: 50;
}

/* ============================================
   CACHER LES ANCIENS PANNEAUX (plus dans le HTML)
   ============================================ */
.themes-panel,
.language-panel,
.right-column,
.auth-status-panel,
.user-status-panel {
    display: none !important;
}



/* ============================================
   2. VIGNETTES COMPACTES
   ============================================ */

/* --- Section Continuer (ligne compacte) --- */
.section-continue {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 10px auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
}

.section-header h3 {
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 1rem;
}

.stories-container {
    padding: 8px 12px;
    margin: 0 8px;
}

/* Story item compact - UNE SEULE LIGNE */
.story-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 78, 59, 0.3) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.story-item:hover {
    transform: translateX(3px);
    border-color: rgba(16, 185, 129, 0.5);
}

.story-item .story-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.story-item .story-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-item .story-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.story-item .story-chapter {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.story-item .story-time {
    opacity: 0.7;
}

.story-item .story-play-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.story-item .story-play-btn img {
    width: 28px;
    height: 28px;
}

/* --- Section Flashcards (vignettes réduites) --- */
.section-flashcards {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 10px auto;
}

.section-flashcards h3 {
    font-size: 0.95rem;
    padding: 8px 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flashcards-container {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 10px;
    margin: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.flashcards-ribbon {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}

.flashcards-ribbon::-webkit-scrollbar {
    display: none;
}

/* Vignette flashcard COMPACTE */
.flashcard-thumb {
    flex-shrink: 0;
    width: 85px;
    height: 90px;
    background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    scroll-snap-align: start;
    transition: all 0.25s ease;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    gap: 4px;
}

.flashcard-thumb:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.flashcard-thumb .thumb-count {
    font-size: 1.8rem;
    font-weight: 800;
    color: #FBBF24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.flashcard-thumb .thumb-name {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 0 6px;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Fake card (Créer) */
.flashcard-thumb.flashcard-empty {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.flashcard-thumb.flashcard-empty:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: none;
}

.flashcard-thumb.flashcard-empty .thumb-icon {
    font-size: 1.5rem;
    opacity: 0.4;
}

.flashcard-thumb.flashcard-empty .thumb-hint {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

/* --- Section HSK (cards compactes) --- */
.section-hsk {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 10px auto;
}

.section-hsk h3 {
    font-size: 0.95rem;
    padding: 8px 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hsk-cards-row {
    display: flex;
    gap: 10px;
    padding: 0 12px 10px 12px;
}

.hsk-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hsk-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.hsk-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.hsk-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.hsk-count {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   3. BROWSER PACK - TOGGLE PACKS/PROFIL
   ============================================ */

/* Layout single-column (plus de 2 colonnes) */
.pack-browser-layout.pack-browser-single-column {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
}

.pack-browser-single-column .packs-section {
    width: 100%;
    max-width: 100%;
}

/* Cacher l'ancienne colonne profil */
.pack-browser-single-column .user-profile-section {
    display: none;
}

/* Bouton Profil dans les filtres */
.btn-profile-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    color: #a5b4fc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-profile-toggle:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
}

.btn-profile-toggle.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    color: #fff;
}

/* Container des vues (packs ou profil) */
.browser-view-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Vue Packs */
.view-packs {
    display: block;
    transition: opacity 0.3s ease;
}

.view-packs.hidden {
    display: none;
}

/* Vue Profil */
.view-profile {
    display: none;
    padding: 1rem;
    overflow-y: auto;
}

.view-profile.visible {
    display: block;
}

/* Cards profil dans la vue toggle */
.view-profile .profile-card {
    background: var(--card-background, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.view-profile .profile-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--text-color, #fff);
}

.view-profile .profile-card-strengths {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.view-profile .profile-card-weaknesses {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.view-profile .profile-card-recommendations {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Items dans profil */
.view-profile .profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.view-profile .profile-item:last-child {
    margin-bottom: 0;
}

.view-profile .item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-color, #fff);
}

.view-profile .item-percentage {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.view-profile .progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 12px;
    overflow: hidden;
}

.view-profile .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.view-profile .profile-card-strengths .progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.view-profile .profile-card-weaknesses .progress-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Recommandations cliquables */
.view-profile .recommendation-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-profile .recommendation-item:hover {
    background: rgba(251, 191, 36, 0.15);
    transform: translateX(4px);
}

/* ============================================
   4. LAYOUT PRINCIPAL AJUSTÉ
   ============================================ */
.main-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: 60px;
}

.main-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background-card, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Logo plus compact */
.app-logo {
    height: 150px;
    margin-bottom: 10px;
}

/* Tutorial button */
.tutorial-button-container {
    margin-top: 15px;
    text-align: center;
}

.sidebar-tutorial-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color, #333);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.sidebar-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Help panel fixe en bas */
.help-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-card, rgba(30, 41, 59, 0.95));
    padding: 8px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 80px;
    overflow-y: auto;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 15px;
}

.help-panel h4 {
    font-size: 0.8rem;
    margin: 0;
    white-space: nowrap;
}

.help-panel .version-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Cacher anciens panneaux */
.themes-panel,
.language-panel,
.right-column,
.auth-status-panel,
.user-status-panel {
    display: none !important;
}

/* ============================================
   5. RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .top-bar {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        gap: 8px;
    }
    
    .top-bar-user .user-name {
        display: none;
    }
    
    .theme-toggle,
    .lang-toggle {
        font-size: 0.85rem;
        padding: 4px 6px;
    }
    
    .main-layout {
        padding-top: 50px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .app-logo {
        height: 120px;
    }
    
    .section-header h3,
    .section-flashcards h3,
    .section-hsk h3 {
        font-size: 0.85rem;
    }
    
    .story-item {
        padding: 8px 10px;
    }
    
    .story-item .story-title {
        font-size: 0.8rem;
    }
    
    .flashcard-thumb {
        width: 70px;
        height: 75px;
    }
    
    .flashcard-thumb .thumb-count {
        font-size: 1.5rem;
    }
    
    .hsk-card {
        padding: 10px 8px;
    }
    
    .hsk-badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

/* ============================================
   ACCORDÉON PROFIL (dans view-profile)
   ============================================ */

/* Card profil = accordéon */
.view-profile .profile-card {
    background: var(--card-background, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header cliquable */
.view-profile .profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.view-profile .profile-card-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.view-profile .profile-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-profile .profile-card-header .accordion-icon {
    font-size: 0.8rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

/* Contenu qui se collapse */
.view-profile .profile-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}

/* État ouvert */
.view-profile .profile-card.open .profile-card-content {
    max-height: 500px;
    padding: 0 16px 16px 16px;
}

.view-profile .profile-card.open .accordion-icon {
    transform: rotate(180deg);
}

/* Couleurs par type */
.view-profile .profile-card-strengths {
    border-left: 3px solid #10b981;
}

.view-profile .profile-card-strengths .profile-card-header:hover {
    background: rgba(16, 185, 129, 0.1);
}

.view-profile .profile-card-weaknesses {
    border-left: 3px solid #ef4444;
}

.view-profile .profile-card-weaknesses .profile-card-header:hover {
    background: rgba(239, 68, 68, 0.1);
}

.view-profile .profile-card-recommendations {
    border-left: 3px solid #fbbf24;
}

.view-profile .profile-card-recommendations .profile-card-header:hover {
    background: rgba(251, 191, 36, 0.1);
}

/* Items dans le contenu */
.view-profile .profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 6px;
}

.view-profile .profile-item:last-child {
    margin-bottom: 0;
}

.recommendation-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.recommendation-item:hover {
    background: rgba(251, 191, 36, 0.15);
    transform: translateX(4px);
}

.recommendation-item .item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recommendation-item .item-reason {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.recommendation-item .item-arrow {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.recommendation-item:hover .item-arrow {
    opacity: 1;
}
	
/* Story item - style "Découvrir" */
.story-item.story-discover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.3) 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.story-item.story-discover:hover {
    border-color: rgba(251, 191, 36, 0.6);
}

/* Badge "Découvrir" */
.story-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.story-badge-new {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}


/* ============================================
   EFFET PULSATION PERMANENTE SUR ICÔNE PLAY
   ============================================ */

/* Container de l'icône */
.story-item .story-play-btn {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cercle pulsant derrière l'icône */
.story-item .story-play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(16, 185, 129, 0.25);
    border-radius: 50%;
    animation: pulse-permanent 1.8s ease-in-out infinite;
    z-index: 0;
}

/* Deuxième cercle pour effet "onde" */
.story-item .story-play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 50%;
    animation: pulse-ring 1.8s ease-out infinite;
    z-index: 0;
}

/* Image de l'icône */
.story-item .story-play-btn img {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
}

/* Animation pulsation du fond */
@keyframes pulse-permanent {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.3;
    }
}

/* Animation cercle qui s'étend */
@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/* ============================================
   VARIANTE DORÉE POUR "DÉCOUVRIR"
   ============================================ */
.story-item.story-discover .story-play-btn::before {
    background: rgba(251, 191, 36, 0.25);
}

.story-item.story-discover .story-play-btn::after {
    border-color: rgba(251, 191, 36, 0.4);
}

.story-item.story-discover .story-play-btn img {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

/* Bouton toggle expand (▼) */
.expand-icon {
    display: inline-block;
    font-size: 1.4em;
    color: rgba(45, 212, 191, 0.9);
    cursor: pointer;
}

/* Pulse uniquement quand PAS expanded */
.expand-icon:not(.expanded) {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

@keyframes pulse-icon {
    0%, 100% { 
        opacity: 0.4;
        text-shadow: 0 0 0 rgba(45, 212, 191, 0);
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 10px rgba(45, 212, 191, 0.8);
    }
}

