﻿/* Global Typography & Reset */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f6f9;
    color: #333;
    min-height: 100vh;
    margin: 0;
    padding-top: 60px; /* Matched to Navbar height */
    overflow-x: hidden;
}

/* Navbar Styling */
.navbar {
    background-color: #1a1a1a; /* Darker, premium black */
    height: 60px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0 1.5rem;
    padding: 0 1.5rem;
}

.navbar .container-fluid {
    display: flex;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto; /* Push to the right */
}

.navbar-icons i {
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.navbar-icons i:hover {
    color: #fff;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: calc(100vh - 60px);
    background: #fff;
    position: fixed;
    top: 60px;
    left: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 1030;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible; /* Allow toggle button to stick out */
    display: flex;
    flex-direction: column;
}

.sidebar .nav {
    flex: 1;
    overflow-y: auto;
    padding-top: 1.5rem;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 70px;
}

/* Sidebar User Info */
.sidebar h4 {
    padding: 0 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar h4.text-black {
    color: #333;
    font-size: 1.1rem;
    text-transform: none;
    letter-spacing: 0;
}

.sidebar.collapsed h4 {
    display: none; /* remove from layout completely */
}

.sidebar hr {
    margin: 1rem 1.5rem;
}

.sidebar.collapsed hr {
    display: none;
}

/* Sidebar Links */
.nav-link {
    color: #555;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background-color: #f8f9fa;
    color: #000;
}

.nav-link.active {
    background-color: #f0f2f5;
    color: #000;
    border-left-color: #000; /* Black accent */
    font-weight: 600;
}

/* Prevent white background on profile icon hover */
#userDropdown.nav-link:hover {
    background-color: transparent !important;
    color: inherit !important;
}

.nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    transition: margin 0.3s;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    padding: 15px 0; /* More padding for touch targets */
    justify-content: center;
    width: 100%;
}

.sidebar.collapsed .nav-link i {
    margin: 0 !important;
    color: #000 !important;
    font-size: 1.5rem; /* Large and clear */
    font-weight: 600;
    display: block; /* Ensure it takes space */
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar.collapsed .nav-link:hover i {
    transform: scale(1.15); /* More visible hover */
    color: #000 !important;
}

/* Sidebar Toggle Button */
.toggle-btn {
    position: absolute;
    right: -14px;
    top: 24px;
    background: #000;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.toggle-btn:hover {
    transform: scale(1.1);
}

/* Main Content */
.content {
    margin-left: 260px; /* Matches Sidebar Width */
    padding: 2rem;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 60px);
}

.content.expanded {
    margin-left: 70px;
}

/* Responsive: Mobile & Tablet (< 992px) */
@media (max-width: 991.98px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%); /* Off-canvas by default */
        left: 0;
    }
    
    .sidebar.open-mobile {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    .content {
        margin-left: 0 !important; /* Full width content */
        padding: 1rem;
    }

    .content.expanded {
        margin-left: 0 !important;
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1025; /* Below sidebar, above navbar content */
        display: none;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }

    /* Toggle button behavior on mobile */
    .toggle-btn {
        display: none; /* Hide default toggle, use navbar hamburger */
    }
}

/* Mobile Navbar Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
}

@media (max-width: 991.98px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Notifications Dropdown Responsive Fix */
@media (max-width: 576px) {
    .unified-notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: calc(100vh - 60px) !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-top: 1px solid #eee;
    }

    .unified-notification-dropdown::before {
        display: none;
    }
}

/* Layout Utilities */
.card-shadow {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.02);
}

/* Scrollbar Polish */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.4);
}