/**
 * Dashboard Layout avec Sidebar
 * Style WordPress/Synchrono
 */

/* Variables couleurs */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
}

/* Layout principal */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo img {
    height: 42px;
    transition: height 0.3s ease;
}

.sidebar.collapsed .sidebar-logo img {
    height: 32px;
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .section-title,
.sidebar.collapsed .menu-badge,
.sidebar.collapsed .user-chevron {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 12px;
    flex-direction: column;
    gap: 12px;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .user-menu {
    justify-content: center;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
}

/* Menu navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 16px 12px 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.menu-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.menu-item-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-item-admin {
    background: rgba(249, 115, 22, 0.1);
    color: #fb923c;
}

.menu-item-admin:hover {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.menu-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* User section en bas */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--sidebar-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    color: #64748b;
    font-size: 0.75rem;
}

.user-chevron {
    color: #64748b;
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    bottom: 70px;
    left: 12px;
    right: 12px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px;
    display: none;
    z-index: 200;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.user-dropdown a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.user-dropdown a.logout {
    color: #f87171;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
    padding-top: 16px;
}

.user-dropdown a.logout:hover {
    background: rgba(248, 113, 113, 0.1);
}

/* Selecteur de langue */
.user-dropdown a.language-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #60a5fa;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
    padding-top: 16px;
}

.user-dropdown a.language-switch:hover {
    background: rgba(96, 165, 250, 0.1);
}

.language-badge {
    margin-left: auto;
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Zone de contenu principale */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}

.content-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 56px;
}

.content-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.content-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.content-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Bouton toggle sidebar */
.sidebar-toggle {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.show {
        display: block;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .content-header {
        padding: 12px 16px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .mobile-overlay {
        display: none !important;
    }
}

/* Scrollbar sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Scrollbar contenu */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.content-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Boutons header */
.header-btn {
    padding: 8px;
    color: #64748b;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Banners (demo, verification, etc.) */
.dashboard-banner {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-banner-demo {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: white;
}

.dashboard-banner-verify {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
}

.dashboard-banner-upgrade {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
}
