/* Sidebar Main Styles */
#sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    transition: left 0.4s ease, right 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 3px 0 12px rgba(0, 0, 0, 0);
    overflow-y: auto;
    z-index: 1050;
    color: var(--text-color);
    border-right: 1px solid var(--primary-color);
    left: -250px;
    right: auto;
}

/* Sidebar Links */
#sidebar .nav-link {
    padding: 12px 15px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 1px solid rgba(243, 167, 44, 0.2);
    border-radius: var(--radius-md);
}

#sidebar .nav-link:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: var(--shadow-sm);
}

#sidebar .nav-link i {
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

#sidebar .nav-link:hover i {
    transform: scale(1.2) rotate(10deg);
}

#headerlogo {
    color: var(--primary-color);
    text-decoration: none;
}

/* Toggle Button */
#sidebarToggle {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    color: var(--primary-text);
}

#sidebarToggle:hover {
    background: var(--card-bg);
    color: var(--primary-color);
    transform: rotate(90deg);
    border: 2px solid var(--primary-color);
}

/* Scrollbar */
#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Layout */
body {
    margin-left: 0;
    transition: margin-left 0.4s ease;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#dropdownmp:hover {
    background: rgba(253, 253, 253, 0.15);
    color: var(--primary-color);
}

#dropdownmmp:hover {
    color: var(--primary-color);
}

#profileDropdown a {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus highlight entirely */
#profileDropdown a:focus,
#profileDropdown a:active {
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Overlay for mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Navbar */
.mobile-navbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--card-bg);
    border-top: 3px solid var(--primary-color);
    z-index: 1070;
    transform: translateY(0);
    transition: transform 0.35s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.mobile-navbar a {
    flex: 1;
    text-align: center;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.mobile-navbar a:hover {
    transform: translateY(-5px) scale(1.1);
    color: var(--primary-color);
}

.mobile-navbar i {
    display: block;
    font-size: 1.4rem;
    color: var(--primary-color);
}

/* Hide animation on scroll (mobile) */
.mobile-navbar.hide {
    transform: translateY(100%);
}

/* Mobile Animation (initial entrance) */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-navbar {
    animation: slideUp 0.45s ease forwards;
}

/* Mobile View */
@media (max-width: 430px) {
    .mobile-navbar {
        display: flex !important;
    }

    /* Sidebar slides from right on mobile */
    #sidebar {
        left: auto;
        right: -250px;
        border-right: none;
        border-left: 1px solid var(--primary-color);
    }
}

/* Tablet & below */
@media (max-width: 990px) {
    body {
        margin-left: 0 !important;
    }

    #sidebar {
        left: -250px;
    }
}

/* Gradient Text */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Profile Trigger Hover */
.profile-trigger:hover img {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Dropdown Items */
.dropdown-item {
    border-radius: var(--radius-md);
    margin: 2px 0;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.05));
    transform: translateX(5px);
}

/* Sidebar Avatar */
.sidebar-avatar {
    position: relative;
}

.sidebar-avatar::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border: 2px solid white;
    border-radius: 50%;
}

/* Badge in Nav Links */
.nav-link .badge {
    font-size: 0.7em;
    padding: 4px 6px;
    background: var(--primary-color);
    color: var(--primary-text);
}

/* Enhanced sidebar styles */
#sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #f8f9fa 100%);
}

#sidebar .nav-link {
    border-radius: var(--radius-md);
    margin: 4px 0;
    border: none;
    background: transparent;
}

#sidebar .nav-link:hover {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.15), rgba(var(--primary-color-rgb), 0.05));
    box-shadow: var(--shadow-md);
}

/* Profile Trigger */
.profile-trigger:hover {
    color: var(--primary-color) !important;
}

.profile-trigger:hover img {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Sidebar Header Hover */
.sidebar-header a:hover h6,
.sidebar-header a:hover small {
    color: var(--primary-color) !important;
}

.sidebar-header a:hover .sidebar-avatar img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Support Highlight */
.support-highlight .nav-link {
    background: linear-gradient(135deg, rgba(243, 167, 44, 0.1), rgba(243, 167, 44, 0.05));
}

.support-highlight .nav-link:hover {
    background: linear-gradient(135deg, rgba(243, 167, 44, 0.2), rgba(243, 167, 44, 0.1));
}

/* Active State */
.nav-link.active {
    background: var(--primary-color) !important;
    color: var(--primary-text) !important;
}

.nav-link.active i {
    color: var(--primary-text) !important;
}

/* Mobile Navbar Fixes for Small Screens */
@media (max-width: 380px) {
    .mobile-navbar {
        height: 60px;
    }

    .mobile-navbar a {
        font-size: 0.8rem;
    }

    .mobile-navbar i {
        font-size: 1.2rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #sidebar {
        border-right: 2px solid var(--primary-color);
    }

    .nav-link {
        border-bottom: 2px solid rgba(var(--primary-color-rgb), 0.3);
    }

    .mobile-navbar {
        border-top: 3px solid var(--primary-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .nav-link,
    #sidebarToggle,
    .mobile-navbar,
    .dropdown-item {
        transition: none !important;
        animation: none !important;
    }

    .nav-link:hover {
        transform: none !important;
    }

    .mobile-navbar {
        animation: none !important;
    }
}