/* ==================== SIDEBAR STYLES ==================== */

/* استخدام متغيرات الألوان من landing/auth pages */
:root {
    --sidebar-bg: var(--bg-card, #ffffff);
    --sidebar-text: var(--text-primary, #0f172a);
    --sidebar-text-secondary: var(--text-secondary, #475569);
    --sidebar-border: var(--border-color, #e2e8f0);
    --sidebar-accent: var(--accent-primary, #0ea5e9);
    --sidebar-hover-bg: var(--bg-secondary, #f8fafc);
    --sidebar-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
    --sidebar-transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

:root[data-theme="dark"] {
    --sidebar-bg: var(--bg-card, #1e293b);
    --sidebar-text: var(--text-primary, #f1f5f9);
    --sidebar-text-secondary: var(--text-secondary, #cbd5e1);
    --sidebar-border: var(--border-color, #334155);
    --sidebar-accent: var(--accent-primary, #0ea5e9);
    --sidebar-hover-bg: var(--bg-secondary, #1e293b);
    --sidebar-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.4));
}

/* 🎨 ألوان الـ Sidebar */
.sidebar-light {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    z-index: 1000;
    transition: var(--sidebar-transition);
    overflow-y: auto;
    color: var(--sidebar-text);
}

.sidebar-light .nav-link {
    color: var(--sidebar-text) !important;
    border-radius: 12px;
    margin: 0.25rem 0.5rem;
    transition: var(--sidebar-transition);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
}

.sidebar-light .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-accent) !important;
    transform: translateX(-5px);
    border-color: var(--sidebar-border);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.sidebar-light .nav-link.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--sidebar-accent) !important;
    font-weight: 600;
    border-right: 3px solid var(--sidebar-accent);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

/* 🎨 ألوان القائمة المنسدلة */
.dropdown-menu-light {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    font-size: 0.95rem;
    box-shadow: var(--sidebar-shadow);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-menu-light .dropdown-item {
    color: var(--sidebar-text);
    transition: var(--sidebar-transition);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0;
}

.dropdown-menu-light .dropdown-item:hover,
.dropdown-menu-light .dropdown-item.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--sidebar-accent);
}

/* 🎨 الهيدر والفوتر */
.sidebar-light .sidebar-header {
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    padding: 1.5rem 1rem;
}

.sidebar-light .sidebar-header h2 {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    margin: 0;
}

.sidebar-light .sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    padding: 1.5rem 1rem;
}

.sidebar-light .text-muted {
    color: var(--sidebar-text-secondary) !important;
}

.sidebar-light .text-light {
    color: var(--sidebar-text) !important;
}

/* 🎨 زر تغيير الـ Theme في Sidebar */
.sidebar-theme-toggle {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    font-weight: 500;
    transition: var(--sidebar-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-theme-toggle:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    border-color: var(--sidebar-accent);
    color: var(--sidebar-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.sidebar-theme-toggle:active {
    transform: translateY(0);
}

.sidebar-theme-toggle #sidebarThemeIcon {
    font-size: 1.1rem;
    transition: var(--sidebar-transition);
}

.sidebar-theme-toggle:hover #sidebarThemeIcon {
    transform: rotate(20deg) scale(1.1);
}

/* 📱 زر القائمة للموبايل */
.mobile-menu-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: var(--sidebar-shadow);
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--sidebar-transition);
    cursor: pointer;
}

.mobile-menu-btn i {
    color: white;
    font-size: 22px;
}

.mobile-menu-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

/* Overlay للخلفية عند فتح القائمة */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.main-content {
    margin-right: 280px;
    transition: margin-right 0.3s ease;
}

/* تحسين السكرول للسايدبار */
.sidebar-light::-webkit-scrollbar {
    width: 6px;
}

.sidebar-light::-webkit-scrollbar-track {
    background: var(--sidebar-hover-bg);
}

.sidebar-light::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 10px;
}

.sidebar-light::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-accent);
}

/* 📱 استايلات الموبايل */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-light {
        transform: translateX(100%);
    }

    .sidebar-light.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .sidebar-light .sidebar-header h2 {
        font-size: 1.5rem;
    }

    .dropdown-menu-light {
        font-size: 16px;
    }

    /* تحسين المسافات للموبايل */
    .sidebar-light .nav-link {
        padding: 0.75rem 1rem;
        font-size: 15px;
    }

    .sidebar-light .dropdown-item {
        padding: 0.65rem 1rem;
        font-size: 14px;
    }
}

/* 📱 شاشات صغيرة جداً */
@media (max-width: 480px) {
    .sidebar-light {
        width: 260px;
    }

    .mobile-menu-btn {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }

    .mobile-menu-btn i {
        font-size: 20px;
    }
}

