/* Dark Mode Styles */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .sidebar {
  background-color: #2d2d2d;
   color: #e0e0e0;
}

body.dark-mode .sidebar a {
  color: #e0e0e0;
}

body.dark-mode .sidebar a:hover {
  background-color: #16a286;
  color: #ffffff;
}

body.dark-mode .sidebar .nav-link.active {
  background-color: #198754 !important;
  color: #ffffff !important;
}

body.dark-mode .main-content {
  background-color: #1a1a1a;
}

body.dark-mode .sidebar::-webkit-scrollbar-track {
  background-color: #2d2d2d;
}

body.dark-mode .sidebar::-webkit-scrollbar-thumb {
  background-color: #16a286;
}

body.dark-mode .logo-text {
  color: #e0e0e0;
}

.sidebar {
    /* background-color: #042954;  for sidebar */
    background-color: #042954;
     color: #e0e0e0;
    width: 250px;
    height: 100vh;
    position: fixed;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, margin-left 0.3s ease;
    box-shadow: 2px 0px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: #2563eb #042954;
}

.logo-text {
    color: whitesmoke;
    font-weight: bold;
    font-size: 10px;
    margin-left: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 10px;
    text-align: center;
}

/* Custom Scrollbar for Sidebar - Matches sidebar background */
.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background-color: #042954;
    border-radius: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #2563eb;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #3b82f6;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed #toggleSidebar {
    padding: 0;
}

.sidebar .nav-link span,
.sidebar .logo-text,
.sidebar .section-title,
.sidebar .logout-text {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .section-title,
.sidebar.collapsed .logout-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    display: none;
}

.sidebar.collapsed .section-title {
    visibility: hidden;
    display: none;
}

.sidebar a {
      color: #e0e0e0;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 8px 8px;
    border-radius: 5px;
    margin-bottom: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar a:hover {
    background-color: #16a286;
    color: #ffffff;
    border-radius: 5px;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(22, 162, 134, 0.3);
}

.sidebar a:active {
    transform: translateX(2px);
    transition: transform 0.1s ease;
}

.sidebar.collapsed a {
    justify-content: center;
    padding: 8px 0;
}

.sidebar.collapsed a i {
    margin: 0 !important;
    margin-left: 10px;
}

.nav-divider {
    border-top: 2px solid #16a286;
    margin: 1rem 0;
}

.sidebar.collapsed .nav-divider {
    margin: 0.5rem 0;
}

.main-content {
    /* Removed fixed height to allow natural growth */
    height: 100vh;
    overflow-x: hidden;
    margin-left: 250px;
    padding: 0px 0px 0px 0px;
    /* background-color: whitesmoke; */
    transition: margin-left 0.3s ease, width 0.3s ease, opacity 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
}

#toggleSidebar {
    border: none;
    background: none;
    color: white;
    font-size:0.888rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 5px;
}

#toggleSidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.sidebar.collapsed #toggleSidebar {
    transform: rotate(180deg);
}

.sidebar .nav-link.active {
    background-color: #198754 !important;
    color: #ffffff !important;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

#logoutButton {
    transition: all 0.3s ease;
}

#logoutButton:hover {
    background-color: #dc3545 !important;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    border: none;
    transition: 400ms;
    outline: none;
}

#logoutButton:focus {
    outline: none;
    box-shadow: none;
}

.sidebar.collapsed #logoutButton {
    padding: 8px 0;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed #logoutButton i {
    margin: 0 !important;
}

/* Page Transition Styles */
.page-transition-fade-out {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.page-transition-fade-in {
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions for all elements */
* {
    transition: all 0.3s ease;
}
details {
    list-style: none;
    padding-left: 0;
}

details summary {
    list-style: none;
    cursor: pointer;
}

details summary::-webkit-details-marker {
    display: none; /* Hide default triangle in WebKit browsers */
}

details li {
    list-style: none; /* Remove bullets from <li> */
    margin-left: 0;
    padding-left: 0;
}

/* Loading overlay styles */
#pageTransitionOverlay {
    backdrop-filter: blur(5px);
}
/* When sidebar is collapsed, center only icons and hide text/content */
.sidebar.collapsed details summary {
    justify-content: center;
    display: flex;
    align-items: center;
}

.sidebar.collapsed details summary span,
.sidebar.collapsed details ul,
.sidebar.collapsed details li span {
    display: none !important;
}

/* Hide the arrow/triangle next to summary in all states */
details summary::-webkit-details-marker {
    display: none;
}

/* Center the icon inside details when collapsed */
.sidebar.collapsed details summary i {
    margin: 0 auto;
    display: block;
}

/* Optional: Adjust padding for collapsed details */
.sidebar.collapsed details summary {
    padding: 8px 0;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 200px; /* Reduced from 250px for mobile */
        transform: translateX(0);
        transition: width 0.3s ease-in-out;
        padding: 0.5rem; /* Reduced padding for mobile */
        height: 100vh;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #2563eb #042954;
    }

    .sidebar.collapsed {
        width: 60px;
    }

    .main-content {
        margin-left: 200px; /* Adjusted margin */
        width: calc(100% - 200px);
      
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
        
    }

    #toggleSidebar {
        display: block;
    }

    /* Reduce font sizes for mobile */
    .sidebar .logo-text {
        font-size: 0.888rem;
        margin: 5px;
    }

    .sidebar a {
        font-size: 0.888rem;
        padding: 6px 8px;
    }

    .sidebar .section-title {
        font-size: 0.888rem;
        margin: 8px 0 4px 0;
    }

    .nav-divider {
        margin: 0.5rem 0;
    }

    .sidebar a:hover {
        transform: translateX(3px);
    }
    
    #toggleSidebar:hover {
        transform: scale(1.05);
    }

    .sidebar::-webkit-scrollbar {
        width: 10px;
    }
    .sidebar::-webkit-scrollbar-thumb {
        background-color: #2563eb;
        border-radius: 5px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .sidebar::-webkit-scrollbar-track {
        background-color: #042954;
        border-radius: 5px;
    }
}

/* For very small screens (less than 480px) */
@media (max-width: 479.98px) {
    .sidebar {
        width: 180px; /* Even more compact for very small screens */
        padding: 0.3rem;
        height: 100vh;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #2563eb #042954;
    }

    .sidebar.collapsed {
        width: 50px; /* Smaller collapsed width */
    }

    .main-content {
        margin-left: 180px;
         width: 100% ;/*   width: calc(100% - 180px); */
        
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 50px;
        width: calc(100% - 50px);
        
    }

    .sidebar .logo-text {
        font-size: 0.888rem;
        margin: 3px;
    }

    .sidebar a {
        font-size: 0.888rem;
        padding: 4px 6px;
    }

    .sidebar .section-title {
        font-size: 0.888rem;
        margin: 6px 0 3px 0;
    }

    .nav-divider {
        margin: 0.3rem 0;
    }

    .sidebar a:hover {
        transform: translateX(2px);
    }

    .sidebar::-webkit-scrollbar {
        width: 10px;
    }
    .sidebar::-webkit-scrollbar-thumb {
        background-color: #2563eb;
        border-radius: 5px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .sidebar::-webkit-scrollbar-track {
        background-color: #042954;
        border-radius: 5px;
    }
}

/* For extra small screens (less than 360px) */
@media (max-width: 359.98px) {
    .sidebar {
        width: 160px; /* Most compact for very small screens */
        padding: 0.2rem;
        height: 100vh;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #2563eb #042954;
    }

    .sidebar.collapsed {
        width: 45px;
    }

    .main-content {
        margin-left: 160px;
        width:100%; /*  width: calc(100% - 160px); */
        
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 45px;
        width: calc(100% - 45px);
        
    }

    .sidebar .logo-text {
        font-size: 0.888rem;
        margin: 2px;
        overflow: hidden;
    }

    .sidebar a {
        font-size: 0.888rem;
        padding: 3px 4px;
        overflow: hidden;
    }

    .sidebar .section-title {
        font-size: 0.888rem;
        margin: 4px 0 2px 0;
        overflow: hidden;
    }

    .sidebar::-webkit-scrollbar {
        width: 10px;
    }
    .sidebar::-webkit-scrollbar-thumb {
        background-color: #2563eb;
        border-radius: 5px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .sidebar::-webkit-scrollbar-track {
        background-color: #042954;
        border-radius: 5px;
    }
}

@media (min-width: 1024px) {
  .contain-select {
    justify-content: flex-start;
  }
  .submit-btn {
    width: auto;
    min-width: 140px;
  }
}
