﻿/* ==========================================================
   HemFoundation - Light & Dark Theme Admin Layout Styles
   ========================================================== */

:root {
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f5f9;
    --sidebar-text: #334155;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --navbar-bg: #ffffff;
}

[data-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #cbd5e1;
    --body-bg: #090d16;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --navbar-bg: #0f172a;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-size: 13.5px;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    align-items: stretch;
}

/* ==========================================================
   SIDEBAR & TOGGLE BEHAVIOR (Fixed & Smooth Slide)
   ========================================================== */
#sidebar {
    min-width: 240px;
    max-width: 240px;
    background: var(--sidebar-bg);
    color: var(--text-main);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    flex-shrink: 0;
}

    /* Jab sidebar active/collapse ho toh ye left side mein poori tarah hide ho jayega */
    #sidebar.active {
        margin-left: -240px;
    }

    #sidebar .sidebar-header {
        height: 60px;
        padding: 0 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        background: var(--sidebar-bg);
        position: sticky;
        top: 0;
        z-index: 2;
    }

        #sidebar .sidebar-header h5 {
            font-size: 1rem !important;
        }

    #sidebar ul.components {
        padding: 10px 8px;
        flex-grow: 1;
    }

    #sidebar ul li a {
        padding: 8px 12px;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        color: var(--sidebar-text);
        border-radius: 6px;
        transition: all 0.2s ease;
        text-decoration: none;
    }

        #sidebar ul li a:hover {
            color: var(--text-main);
            background: var(--sidebar-hover);
            transform: translateX(3px);
        }

    #sidebar ul.collapse {
        border-left: 2px solid var(--border-color);
        margin-left: 20px;
        padding-left: 6px;
        margin-top: 2px;
        margin-bottom: 2px;
    }

        #sidebar ul.collapse li a {
            padding: 6px 10px;
            font-size: 0.8rem;
        }

.sidebar-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    background: var(--sidebar-bg);
}

/* ==========================================================
   MAIN CONTENT AREA (Expands when sidebar collapses)
   ========================================================== */
#content {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--body-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-custom {
    height: 60px;
    background: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 1050;
    padding: 0 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* UI Elements Polish */
.dropdown-toggle::after {
    display: none !important;
}

.profile-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3) !important;
}

.dropdown-menu {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    z-index: 1090 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2) !important;
}

.dropdown-item {
    color: var(--text-main) !important;
}

    .dropdown-item:hover {
        background-color: var(--sidebar-hover) !important;
    }

[data-theme="dark"] .profile-dropdown-card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #profile-name {
    color: var(--text-main) !important;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -240px;
        position: fixed;
    }

        #sidebar.active {
            margin-left: 0;
        }
}
