/**
 * THEME MODERNE SIDEBAR - NOUVEAU DESIGN COMPLET
 * Inspiré de l'image avec card dorée/marron et modules numérotés
 * OVERRIDE COMPLET DES ANCIENS STYLES
 */

/* RESET des anciens styles pour éviter les conflits */
.sidebar-menu-item.theme-card-modern,
.sidebar-menu-item.theme-card-modern * {
    /* Reset des styles Bootstrap et anciens */
    box-sizing: border-box;
}

.sidebar-menu-item.theme-card-modern a.sidebar-menu-button,
.sidebar-menu-item.theme-card-modern .sidebar-menu-button,
.sidebar-menu-item.theme-card-modern .theme-item-vertical {
    /* Désactiver les anciens styles */
    all: unset;
    display: block;
}

/* Theme Card Container */
.sidebar-menu-item.theme-card-modern {
    margin: 0.5rem 0 !important;
    padding: 0 !important;
    background: #252525 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
}

.sidebar-menu-item.theme-card-modern:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-1px) !important;
    background: #2f2f2f !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Theme Header */
.theme-modern-header {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    padding: 0.75rem 0.875rem 0.5rem !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: background 0.2s ease !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    text-decoration: none !important;
}

.theme-modern-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-modern-header[aria-expanded="true"] .theme-toggle-arrow {
    transform: rotate(180deg);
}

/* Theme Icon */
.theme-modern-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.theme-modern-icon .material-icons {
    color: #ffffff;
    font-size: 20px;
}

/* Theme Info */
.theme-modern-info {
    flex: 1;
    min-width: 0;
}

.theme-modern-title {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-modern-stats-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.theme-modern-stats {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    flex-shrink: 0;
}

.theme-stat-separator {
    opacity: 0.6;
    margin: 0 0.1rem;
}

/* Toggle Arrow */
.theme-toggle-arrow {
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Progress Bar */
.theme-modern-progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    min-width: 60px;
}

.theme-modern-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* Modules List Container */
.theme-modern-modules {
    padding: 0 0.5rem 0.5rem;
}

.theme-modern-modules.show {
    animation: slideDown 0.3s ease;
}

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

/* Module Item */
.theme-modern-module-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 0.35rem;
    text-decoration: none !important;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Retire TOUT soulignement des liens de modules */
a.theme-modern-module-item,
a.theme-modern-module-item:hover,
a.theme-modern-module-item:focus,
a.theme-modern-module-item:active,
a.theme-modern-module-item:visited {
    text-decoration: none !important;
    color: inherit !important;
}

.theme-modern-module-item:last-child {
    margin-bottom: 0;
}

.theme-modern-module-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(3px);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.theme-modern-module-item.completed {
    background: rgba(0, 208, 132, 0.15);
    border-color: rgba(0, 208, 132, 0.4) !important;
}

.theme-modern-module-item.completed:hover {
    background: rgba(0, 208, 132, 0.25);
}

/* Module Number Badge */
.module-number-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.module-number-badge:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.module-number-text {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.module-check-icon {
    color: #00D084;
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 208, 132, 0.4));
}

/* Module Content */
.module-content-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.module-title-text {
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    text-decoration: none !important;
}

.module-duration-text {
    display: none !important;
}

.module-duration-text .material-icons {
    display: none !important;
}

/* Module Arrow */
.module-arrow-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.theme-modern-module-item:hover .module-arrow-icon {
    color: rgba(255, 255, 255, 0.8);
    transform: translateX(3px);
}

/* Dark Mode Support */
body.dark-mode .theme-card-modern {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar-menu-item.theme-card-modern {
        margin: 0.5rem 0.35rem;
        border-radius: 14px;
    }
    
    .theme-modern-header {
        padding: 0.875rem 1rem 0.65rem;
        gap: 0.75rem;
    }
    
    .theme-modern-icon {
        width: 42px;
        height: 42px;
    }
    
    .theme-modern-icon .material-icons {
        font-size: 24px;
    }
    
    .theme-modern-title {
        font-size: 0.95rem;
    }
    
    .theme-modern-stats {
        font-size: 0.75rem;
    }
    
    .theme-modern-modules {
        padding: 0 0.5rem 0.5rem;
    }
    
    .theme-modern-module-item {
        padding: 0.65rem 0.75rem;
        gap: 0.75rem;
        margin-bottom: 0.4rem;
    }
    
    .module-number-badge {
        width: 32px;
        height: 32px;
    }
    
    .module-number-text {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .module-check-icon {
        font-size: 32px;
    }
    
    .module-title-text {
        font-size: 0.85rem;
    }
    
    .module-duration-text {
        font-size: 0.7rem;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .theme-modern-title {
        font-size: 0.9rem;
    }
    
    .theme-modern-stats {
        font-size: 0.7rem;
    }
    
    .module-title-text {
        font-size: 0.8rem;
    }
}

/* Animation pour l'apparition des modules */
.theme-modern-module-item {
    animation: fadeInModule 0.3s ease backwards;
}

.theme-modern-module-item:nth-child(1) { animation-delay: 0.05s; }
.theme-modern-module-item:nth-child(2) { animation-delay: 0.1s; }
.theme-modern-module-item:nth-child(3) { animation-delay: 0.15s; }
.theme-modern-module-item:nth-child(4) { animation-delay: 0.2s; }
.theme-modern-module-item:nth-child(5) { animation-delay: 0.25s; }

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

/* Smooth scroll pour la sidebar */
.sidebar-menu {
    scroll-behavior: smooth;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* Focus states pour l'accessibilité */
.theme-modern-header:focus,
.theme-modern-module-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}
