/* Variables CSS pour les couleurs modernes */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --footer-height: 50px;
}

/* Layout principal */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-secondary);
}

/* Sidebar moderne */
.sidebar {
    width: var(--sidebar-width) !important;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%) !important;
    box-shadow: var(--shadow-lg);
    position: fixed !important;
    height: 100vh !important;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    display: block !important;
}

/* Header de navigation */
.nav-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    color: var(--primary-light);
    font-size: 1.5rem;
}

.brand-text {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Menu de navigation */
.nav-menu {
    padding: 1rem 0 !important;
    flex: 1;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-section {
    margin-bottom: 2rem;
    display: block !important;
    visibility: visible !important;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.nav-section-title i {
    font-size: 0.875rem;
}

/* Items de navigation */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0 0.75rem;
    border-radius: 0.5rem;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    text-decoration: none;
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: var(--accent-color);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
}

.nav-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Badge de notification */
.nav-item.has-notification {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

/* Footer de navigation */
.nav-footer {
    margin-top: auto;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-action {
    margin: 0.25rem 0.75rem;
}

.nav-action.logout:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.nav-action.login:hover {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

/* Contenu principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    box-sizing: border-box;
}

/* Header principal */
.top-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 100%;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.025em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Zone de contenu */
.content-area {
    flex: 1;
    padding: 2rem;
    background-color: var(--bg-secondary);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Footer de l'application */
.app-footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    height: var(--footer-height);
    display: flex;
    align-items: center;
}

.footer-content {
    padding: 0 2rem;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu.collapse {
        display: none;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .footer-content {
        padding: 0 1rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }
    
    .nav-item {
        padding: 1rem 1.25rem;
    }
    
    .nav-text {
        font-size: 0.95rem;
    }
}
