body{
    font-family: 'Poppins', sans-serif;
}

nav ul {
    list-style: none;
    padding: 0;
    margin-top: 70px;
    width: 100%;
    text-align: center;
    overflow-x: hidden;
    width: 100%;
}

.menu-item a i {
  color: red;
  transition: color 0.3s;
}

li.menu-item.active {
    background: white !important;
}
li.menu-item.active a {
    color: #FFC107 !important;
}
li.menu-item.active i {
    color: #FFC107 !important;
}

.menu-item:hover a {
    color: #FFD000;
}
.menu-item:hover i {
    color: #FFD000;
}

/* Tooltip */
/* .menu-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    background: black;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
} */

.menu-item:hover::after {
    opacity: 1;
}

/* Profile Section */
.sidebar .profile-container {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 2px solid rgb(255, 255, 255);
    margin-bottom: 3rem;
}

.sidebar .profile-picture {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgb(255, 255, 255);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
}

.sidebar .profile-picture:hover {
    transform: scale(1.05);
    border-color: #ffffff;
}

.sidebar .profile-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar .profile-username {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}


/* Sidebar */
.sidebar {     
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 325px;
    background: #001A6e;
    position: fixed;
    top: 50px;
    left: 0;
    z-index: 999;
}

.sidebar.active {
    display: flex;
}

/* Sidebar transition */
.sidebar {
    transition: transform 0.3s ease-in-out;
}

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

.sidebar:not(.hidden) {
    transform: translateX(0);
}

/* Backdrop styles */
#sidebarBackdrop {
    transition: opacity 0.3s ease-in-out;
}

.sidebar {
    overflow-x: hidden; /* Prevent horizontal overflow inside sidebar */
}

/* This prevents the content inside the sidebar from overflowing */
.sidebar .profile-container,
.sidebar nav,
.sidebar-footer {
    overflow-x: hidden;
}

/* Hamburger icon rotation */
.hamburger-menu.active i {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

/* Example */
.menu-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 80%;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 999;
  max-width: 70vw;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Responsive widths respected */
@media (max-width: 576px) {
    .sidebar {
        width: 100vw;
    }
}


/* Hamburger menu styles */
.hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin-right: 10px;
}

/* For mobile view */
@media (max-width: 767px) {
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar {
        padding-top: 80px; /* Give space for header */
    }
}

/* ===== Visual Enhancements ===== */
/* These additions won't affect functionality */

/* Sidebar Background Enhancement */
.sidebar {
    background: linear-gradient(135deg, #001A6e 0%, #00308F 100%);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

.menu-item {
    transition: all 0.2s ease;
    margin: 12px 10px;
    border-radius: 8px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(5px);
}

.menu-item.active {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Icons Enhancement */
.menu-item a i {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tooltip Enhancement */
.menu-item:hover::after {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* Scrollbar (optional) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
} */

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  padding-bottom: 10%;
  border-radius: var(--border-radius);
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* ===== Existing Code Below ===== */
/* ALL YOUR EXISTING CSS REMAINS EXACTLY THE SAME BELOW THIS LINE */
/* This ensures none of your functionality is affected */

/* ==================== */
/* RESPONSIVE ADJUSTMENTS */
/* ==================== */

@media (max-width: 1600px) {
    .sidebar {
        width: 280px;
    }
    
    .profile-picture {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .profile-username {
        font-size: 0.8rem;
    }
    
    .menu-item {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .profile-container {
        padding: 1rem;
    }
    
    .menu-item {
        margin: 8px;
    }
    
    /* Hide tooltips on mobile */
    .menu-item:hover::after {
        display: none;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 220px;
    }
    
    .profile-picture {
        width: 60px;
        height: 60px;
    }
    
    .profile-name {
        font-size: 0.9rem;
    }
    
    .menu-item p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
    }
    
    .menu-item {
        padding: 0.5rem;
    }
    
    .icon-container {
        width: 24px;
    }
}

/* ======================= */
/* GENERAL ENHANCEMENTS */
/* ======================= */

/* Maintain aspect ratio for profile picture */
.profile-picture {
    aspect-ratio: 1/1;
}

/* Ensure all interactive elements have proper touch targets */
@media (max-width: 992px) {
    .menu-item,
    .logout-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Smooth transitions for sidebar */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0; /* Ensure there's no unwanted margin */
    padding: 0; /* Ensure there's no unwanted padding */
}

/* Loading state for better UX */
.profile-picture.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}