/* ============================================
   DASHBOARD - User Interface
   ============================================ */

/*
   Note: Layout is shared with admin.css
   Sidebar styles are duplicated here because user dashboard
   might load independently of admin.css
*/

.dashboard-layout {
    min-height: 100vh;
    background: var(--color-bg-body);
    display: flex;
}

.dashboard-main {
    background: var(--color-bg-body);
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ── Sidebar - Premium Redesign ── */
.dashboard-sidebar {
    width: var(--admin-sidebar-width);
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0; /* Default for admin/no-navbar */
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 990;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Offset only when navbar is present on desktop */
@media (min-width: 1025px) {
    .navbar-modern ~ .dashboard-layout .dashboard-sidebar,
    .navbar-modern ~ main .dashboard-sidebar,
    .navbar-modern ~ .dashboard-sidebar {
        top: var(--navbar-height);
        height: calc(100vh - var(--navbar-height));
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-user {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(230, 0, 0, 0.05) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 16px rgba(230, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    text-align: center;
}

.user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.user-email {
    color: var(--color-primary-light);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Navigation Items */
.sidebar-nav {
    padding: 1.5rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    border-left: 4px solid transparent;
}

.nav-item .icon {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 1.75rem;
}

.nav-item:hover .icon {
    transform: translateX(3px);
    color: var(--color-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(230, 0, 0, 0.15) 0%, transparent 100%);
    color: white;
    border-left-color: var(--color-primary);
    font-weight: 700;
}

.nav-item.active .icon {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary-alpha);
}

.nav-item.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-danger);
    opacity: 0.8;
}

.nav-item.logout:hover {
    background: rgba(255, 23, 68, 0.1);
    opacity: 1;
}

/* ── Mobile Responsive (Bottom Navigation v2) ── */
@media (max-width: 1024px) {
    .dashboard-main {
        margin-left: 0;
        padding-bottom: 100px; /* Space for bottom bar */
    }

    .dashboard-sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        background: rgba(10, 10, 10, 0.9);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        overflow: visible; /* Allow active item to pop out */
        padding: 0 10px;
        justify-content: space-around;
        align-items: center;
        z-index: 2000;
    }

    /* Hide sidebar elements that don't fit the bar */
    .sidebar-user, .sidebar-header, .nav-item.logout {
        display: none !important;
    }

    .sidebar-nav {
        display: flex;
        width: 100%;
        justify-content: space-between;
        padding: 0;
        height: 100%;
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        padding: 0;
        border-left: none;
        height: 100%;
        gap: 4px;
        position: relative;
    }

    .nav-item .icon {
        margin-right: 0;
        font-size: 1.25rem;
        margin-bottom: 2px;
    }

    .nav-label {
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .nav-item:hover {
        background: transparent;
        padding-left: 0;
    }

    /* ── Raised Active State Indicator ── */
    .nav-item.active {
        background: transparent;
    }

    .nav-item.active .icon {
        background: var(--gradient-primary);
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        position: absolute;
        top: -25px; /* Pop up higher */
        color: white;
        box-shadow: 0 8px 20px rgba(230, 0, 0, 0.4);
        border: 4px solid #0a0a0a; /* Match bar background */
        z-index: 2;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .nav-item.active .nav-label {
        position: absolute;
        bottom: 6px;
        left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0;
        color: var(--color-primary);
        font-weight: 800;
        z-index: 5;
    }

    /* Smooth Curve Effect */
    .nav-item.active::before {
        content: '';
        position: absolute;
        top: -12px;
        width: 80px;
        height: 40px;
        background: transparent;
        border-radius: 50%;
        box-shadow: 0 20px 0 0 #0a0a0a; /* Creates the concave cutout */
        z-index: 0;
        pointer-events: none;
    }

    /* Disable Mobile Sidebar Toggle Button for Profile */
    .mobile-sidebar-toggle {
        display: none !important;
    }
}
