/* Sidebar Component Styles */

/* Sidebar styles */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: #000;
    color: white;
    padding-top: 20px;
    z-index: 1000;
    transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
  }
  
  .sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
  }
  
  .sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: white;
    color: black;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
  }
  
  .sidebar-toggle i {
    transition: transform var(--transition-speed);
  }
  
  .sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
  }
  
  
  
  /* Logo container in sidebar */
  .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 0 20px;
    transition: justify-content var(--transition-speed);
  }
  
  .logo {
    height: 35px;
    margin-right: 10px;
  }
  
  .logo-text {
    color: white;
    font-size: 22px;
    font-weight: 600;
    transition: opacity var(--transition-speed);
  }
  
  .sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }
  
  .sidebar.collapsed .logo-container {
    justify-content: center;
  }
  
  /* Nav items in sidebar */
  .nav-item {
    margin-bottom: 5px;
    border-radius: 10px;
    overflow: hidden;
  }
  
  .nav-link {
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed);
    margin:0px 18px;
    border-radius: 50px;
  }
  
  .nav-link i {
    margin-right: 10px;
    font-size: 18px;
    min-width: 20px;
    text-align: center;
  }
  
  .sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }
  
  .nav-link.active {
    background-color: #fff;
    color:var(--green-progress);
    border-radius: 10px;
    font-weight: 600;
    margin: 18px;
    border-radius: 50px;
  }
  
  .nav-link:hover:not(.active) {
    background-color: white;
    color: var(--green-progress);
  }
  
  /* Main content area related to sidebar */
  .main-content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
  }
  
  .main-content.expanded {
    margin-left: var(--sidebar-width-collapsed);
  }
  



/* Desktop Sidebar Active State when Collapsed */
.sidebar.collapsed .nav-link.active {
  background-color: white !important;
  border-radius: 50px !important;
  padding: 12px !important;
  margin: 0 auto !important;
  width: 45px !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .nav-link.active i {
  color: var(--green-progress) !important;
  margin-right: 0 !important;
}

.sidebar.collapsed .nav-link {
  justify-content: center !important;
  padding: 12px !important;
  margin: 0 auto !important;
  width: 45px !important;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0 !important;
}


  /* Mobile sidebar styles */
  @media(max-width:768px) {
    .sidebar.mobile-open {
      transform: translateX(0);
      width: 240px;
    }
    
    .sidebar {
      transform: translateX(-100%) !important;
      width: var(--sidebar-width) !important;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 1050;
    }
    
    /* Only show sidebar when the mobile-open class is present */
    .sidebar.mobile-open {
      transform: translateX(0) !important;
    }
    
    /* Make sure desktop sidebar toggle is hidden on mobile */
    .sidebar-toggle {
      display: none !important;
    }
    
    /* Ensure the mobile sidebar toggle is visible */
    .mobile-sidebar-toggle {
      display: block !important;
    }
    
 
    
    /* Mobile header */
    .mobile-header {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 60px;
      background-color: #000;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 15px;
      z-index: 1000;
      color: white;
    }
    
    .mobile-sidebar-toggle {
      background: none;
      border: none;
      color: white;
      font-size: 20px;
      cursor: pointer;
    }
    
    .mobile-logo {
      display: flex;
      align-items: center;
    }
    
    .mobile-logo .logo {
      height: 30px;
      margin-right: 10px;
    }
    
    .mobile-actions {
      display: flex;
      align-items: center;
    }
    
    /* Make sure the mobile header is visible */
    .mobile-header {
      display: flex !important;
      height: 56px;
    }
    
    /* Hide desktop header */
    .top-header {
      display: none !important;
    }
    
    /* Main content mobile adjustment */
    .main-content {
      margin-left: 0;
      padding-top: 70px;
    }


/* Initial Hidden State - Fix Active Button */
.sidebar:not(.mobile-open) .nav-link.active {
  background-color: transparent !important;
  color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.sidebar:not(.mobile-open) .nav-link.active i {
  color: transparent !important;
}

/* Ensure text is visible when sidebar is open on mobile */
.sidebar.mobile-open .nav-link span {
  opacity: 1 !important;
  width: auto !important;
  display: inline-block !important;
  visibility: visible !important;
  margin-left: 10px !important;
  color: white !important;
}

/* Fix active state to only show when sidebar is open */
.sidebar.mobile-open .nav-link.active {
  background-color: white !important;
  color: var(--green-progress) !important;
  border-radius: 50px !important;
  padding: 12px 20px !important;
  margin: 0px 15px !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
}

.sidebar.mobile-open .nav-link.active i {
  color: var(--green-progress) !important;
  margin-right: 10px !important;
}

.sidebar.mobile-open .nav-link.active span {
  color: var(--green-progress) !important;
}

/* Normal nav link styles when sidebar is open */
.sidebar.mobile-open .nav-link {
  padding: 12px 20px !important;
  margin: 0px 15px !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  color: white !important;
}

.sidebar.mobile-open .nav-link i {
  margin-right: 10px !important;
  color: white !important;
}

/* Hover effects only when sidebar is open */
.sidebar.mobile-open .nav-link:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-radius: 50px !important;
}

/* Add overlay when sidebar is open */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}


/* Dark mode adjustments */
body.dark-mode .sidebar.collapsed .nav-link.active {
background-color: var(--primary-color) !important;
}

body.dark-mode .sidebar.collapsed .nav-link.active i {
color: white !important;
}

@media(max-width:768px) {
body.dark-mode .sidebar.mobile-open .nav-link.active {
  background-color: var(--primary-color) !important;
  color: white !important;
}

body.dark-mode .sidebar.mobile-open .nav-link.active i,
body.dark-mode .sidebar.mobile-open .nav-link.active span {
  color: white !important;
}

body.dark-mode .sidebar.mobile-open .nav-link i,
body.dark-mode .sidebar.mobile-open .nav-link span {
  color: #e0e0e0 !important;
}

body.dark-mode .sidebar.mobile-open .nav-link:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.1) !important;
}
}







.sidebar.mobile-open .dashboard-dropdown {
  position: relative !important;
  margin: 0 15px !important;
  z-index: 1010 !important;
}

.sidebar.mobile-open .dashboard-dropdown .dropdown-item {
  padding: 10px 15px !important;
  margin-top: 14px;
}

/* Add space to prevent dropdown from creating a scrollbar */
.sidebar.mobile-open .nav {
  overflow: visible !important;
}

/* Ensure dropdown doesn't create overflow */
.sidebar.mobile-open {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}


  }











  
  /* Dark mode styles for sidebar */
  body.dark-mode .sidebar {
    background-color: #1e1e1e;
    color: #e0e0e0;
  }
  
  body.dark-mode .sidebar-toggle {
    background-color: #1e1e1e;
    color: #e0e0e0;
  }
  
  body.dark-mode .sidebar .nav-link:not(.active) {
    color: #e0e0e0 !important;
  }
  
  body.dark-mode .sidebar .nav-link.active {
    background-color: var(--primary-color) !important;
    color: white !important;
  }
  
  body.dark-mode .sidebar .nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1) !important;
  }
  
  body.dark-mode .mobile-header {
    background-color: #1e1e1e;
  }







  /* Dashboard Dropdown Styles */

/* Dropdown container */
.dashboard-dropdown {
  background-color: #000;
  border-radius: 8px;
  margin: 0 10px;
  overflow: hidden;
  transition: all var(--transition-speed);
  z-index: 1005;
}

/* Dropdown items */
.dropdown-item {
  color: white;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 5px;
}

.dropdown-item i {
  margin-right: 10px;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown icon */
.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
}

/* Collapsed sidebar states */
.sidebar.collapsed .dashboard-dropdown {
  background-color: #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .dropdown-item span {
  opacity: 1;
  width: auto;
  overflow: visible;
}

/* Dark mode styles */
body.dark-mode .dashboard-dropdown {
  background-color: #1e1e1e;
}

body.dark-mode .dropdown-item {
  color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}




/* Add these styles to your existing CSS */

/* Dropdown item active state */
.dropdown-item.active {
  background-color: white;
  color: var(--green-progress) !important;
  font-weight: 600;
  border-radius: 50px;
  padding: 12px 15px;
  font-size: small;
  margin: -1px;
}

.dropdown-item.active i {
  color: var(--green-progress) !important;
}

/* Hover effect matching the main nav links */
.dropdown-item:hover {
  background-color: white;
  color: var(--green-progress) !important;
  border-radius: 50px;
  padding: 12px 20px;
  margin: -1px;
  margin-top: 5px;
}


.dropdown-item:hover i {
  color: var(--green-progress) !important;
}

/* Dark mode styles */
body.dark-mode .dropdown-item.active {
  background-color: var(--primary-color);
  color: white !important;
}

body.dark-mode .dropdown-item.active i {
  color: white !important;
}

body.dark-mode .dropdown-item:hover {
  background-color: var(--primary-color);
  color: white !important;
}

body.dark-mode .dropdown-item:hover i {
  color: white !important;
}




/* Fix for blue highlight/focus state on ALL navigation elements - aggressive solution */
.sidebar .nav-link,
.nav-link,
button,
a,
.dropdown-item,
[role="button"],
[type="button"],
.sidebar-toggle,
.mobile-sidebar-toggle,
*:focus,
*:active {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    user-select: none !important;
}

/* Override browser default focus styles */
*:focus {
    outline: none !important;
}

/* Explicitly remove default button styling */
button:focus,
button:active {
    outline: none !important;
    background-image: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Force color to be controlled by CSS, not browser */
.sidebar .nav-link:focus,
.sidebar .nav-link:active {
    color: inherit !important;
    background-color: transparent !important;
}

/* Only apply active styles explicitly defined */
.nav-link.active {
    background-color: #fff !important;
    color: var(--green-progress) !important;
}

  