/* Sidebar Styles - Basé sur design/menu.json */

/* Style du body */
body {
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Variables CSS pour les couleurs */
:root {
    --sidebar-bg: #1E293B;
    --sidebar-text: #F8FAFC;
    --sidebar-text-muted: #94A3B8;
    --sidebar-hover: #334155;
    --sidebar-active: #3B82F6;
    --sidebar-border: #475569;
    --highlight-bg: #F1F5F9;
    --highlight-text: #1E293B;
    --highlight-accent: #EC4899;
}

/* Sidebar principale - repliée par défaut */
.sidebar {
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: -280px; /* Repliée par défaut */
    top: 0;
    z-index: 9999;
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    transition: left 0.3s ease;
    /* Forcer la sidebar au-dessus de tout */
    transform: translateZ(0);
    will-change: transform;
    

}

/* Sidebar ouverte */
.sidebar.open {
    left: 0;
}

/* Header de la sidebar */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--sidebar-text);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-left-color: var(--sidebar-active);
}

.nav-link.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-left-color: var(--sidebar-active);
}

.nav-link.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-link.disabled:hover {
    background: transparent;
    color: var(--sidebar-text-muted);
    border-left-color: transparent;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.6) contrast(1);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1) contrast(1);
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

/* Section mise en évidence "Mes temps" */
.sidebar-highlight {
    margin: 20px;
    padding: 20px;
    background: var(--highlight-bg);
    border-radius: 12px;
    border: 1px solid var(--sidebar-border);
}

.highlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.highlight-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--highlight-text);
    margin: 0;
}

.hour-indicator {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.hour-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--highlight-accent);
}

.hour-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--highlight-text);
}

.highlight-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--sidebar-active);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    justify-content: center;
}

.highlight-button:hover {
    background: #2563EB;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.highlight-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1) contrast(1);
}



/* Contenu principal sans marge pour la sidebar */
.main-content {
    margin-left: 0;
    margin-top: 70px; /* Espace pour la barre de navigation fixe */
    min-height: 100vh;
    background: #f8f9fa;
    transition: margin-left 0.3s ease;
    padding: 20px;
}

/* Contenu principal avec marge quand la sidebar est ouverte */
.main-content.sidebar-open {
    margin-left: 280px;
}

/* Barre de navigation supérieure */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -280px; /* Toujours repliée sur mobile */
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.sidebar-open {
        margin-left: 0; /* Pas de marge sur mobile */
    }
    

}

/* Scrollbar personnalisée */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-hover);
}

/* Animation d'entrée */
.sidebar {
    animation: none; /* Supprimé l'animation d'entrée */
}

/* États des liens */
.nav-link[href="#"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-link[href="#"]:hover {
    background: transparent;
    color: var(--sidebar-text-muted);
    border-left-color: transparent;
}

/* Overlay pour fermer la sidebar en cliquant à l'extérieur */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}
