/*
 * TailAdmin Integration Styles
 * Custom CSS adapting TailAdmin template for Masi Chat admin interface
 * Enhanced with Masi Chat brand colors (#ea7351, #E03274) and full dark mode support
 */

/* Masi Chat Brand Color Variables */
:root {
  --mc-primary: #ea7351;          /* Masi Chat Orange */
  --mc-primary-hover: #d65a32;    /* Darker orange on hover */
  --mc-secondary: #E03274;        /* Masi Chat Pink */
  --mc-secondary-hover: #c42863;  /* Darker pink on hover */
  --mc-gradient: linear-gradient(135deg, #ea7351 0%, #E03274 100%);
  --mc-accent: rgba(234, 115, 81, 0.1);  /* Light orange background */
  --mc-accent-hover: rgba(234, 115, 81, 0.2);  /* Stronger orange background */
}

/* Alpine.js and Core Variables */
[x-cloak] { display: none !important; }

.sidebar {
  transition: all 0.3s ease;
}

/* Sidebar Base Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow-y: hidden;
  border-right: 1px solid #e5e7eb;
  background-color: #ffffff;
  padding: 0 1.25rem;
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width: 90px;
}

.dark .sidebar {
  border-right-color: #374151;
  background-color: #000000;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 2rem;
  padding-bottom: 1.75rem;
  justify-content: space-between;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar .logo {
  display: block;
}

.sidebar.collapsed .logo {
  display: none;
}

.sidebar .logo-icon {
  display: none;
}
.sidebar.collapsed .logo-icon {
  display: block;
}

@media (min-width: 1280px) {
  body > div.mc-main.mc-admin.mc-cloud .sidebar:not(.collapsed) ~ div .mc-user-details.mc-active {
    display: none;
  }
}

/* =================================================================== */
/* MASI CHAT BRAND ENHANCEMENTS */
/* =================================================================== */

/* Header Button Styling with Brand Colors */
.mc-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 1px solid transparent;
}

.mc-header-btn:hover {
  background: var(--mc-accent-hover);
  color: var(--mc-primary);
  border-color: var(--mc-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 115, 81, 0.2);
}

.dark .mc-header-btn {
  color: #9ca3af;
}

.dark .mc-header-btn:hover {
  background: rgba(234, 115, 81, 0.15);
  color: var(--mc-primary);
  border-color: var(--mc-primary);
}

/* Search Input with Brand Colors */
.mc-search-input {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 14px;
  color: #374151;
  width: 240px;
  transition: all 0.2s ease;
}

.mc-search-input:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 0 3px var(--mc-accent);
  background: #ffffff;
}

.dark .mc-search-input {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .mc-search-input:focus {
  border-color: var(--mc-primary);
  background: #1f2937;
}

/* Notification Badge with Brand Colors */
.mc-notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--mc-gradient);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: none; /* Start hidden by default */
}

/* Profile Dropdown with Brand Colors */
.mc-profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.mc-profile-btn:hover {
  background: var(--mc-accent);
  border-color: var(--mc-primary);
}

.dark .mc-profile-btn:hover {
  background: rgba(234, 115, 81, 0.15);
}

/* Dropdown Menu Items with Brand Colors */
.mc-profile-menu-item:hover,
.mc-notification-item:hover {
  background: var(--mc-accent);
  color: var(--mc-primary);
  transition: all 0.2s ease;
}

.dark .mc-profile-menu-item:hover,
.dark .mc-notification-item:hover {
  background: rgba(234, 115, 81, 0.15);
  color: var(--mc-primary);
}

/* Status Indicator with Brand Colors */
.mc-status-indicator.mc-online {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
  animation: pulse-green 2s infinite;
}

.mc-status-indicator.mc-offline {
  background-color: #6b7280;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Brand Gradient Accent Elements */
.mc-brand-accent {
  background: var(--mc-gradient);
  color: white;
}

.mc-brand-text {
  color: var(--mc-primary);
}

.mc-brand-border {
  border-color: var(--mc-primary);
}

/* Enhanced Button Styles */
.mc-btn-primary {
  background: var(--mc-gradient);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(234, 115, 81, 0.3);
}

/* Sidebar Animation Enhancements */
.sidebar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  transform: translateX(0);
}

/* Menu Item Hover Effects */
.menu-item {
  position: relative;
  overflow: hidden;
}


/* Logo Enhancements */
.sidebar .logo img,
.sidebar .logo-icon {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar .logo:hover img,
.sidebar .logo-icon:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(234, 115, 81, 0.2));
}

/* Dark Mode Transition Effects */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dark body {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
}

/* Enhanced Focus States */
.mc-header-btn:focus,
.theme-toggle:focus,
.mc-dark-toggle:focus {
  outline: 2px solid var(--mc-primary);
  outline-offset: 2px;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .mc-header-btn {
    width: 40px;
    height: 40px;
  }
  
  .mc-search-input {
    width: 200px;
  }
}

/* Print Styles - Hide interactive elements */
@media print {
  .mc-dark-toggle,
  .mc-notification-btn,
  .mc-profile-btn,
  .sidebar {
    display: none !important;
  }
}

/* Menu Styles */
.menu-group-title {
  margin-bottom: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  line-height: 1.25rem;
  color: #9ca3af;
  display: inline;
}

.sidebar.collapsed .menu-group-title {
  display: none;
}

.menu-group-icon {
  display: none;
  margin: 0 auto;
  fill: currentColor;
}

.sidebar.collapsed .menu-group-icon {
  display: block;
}

/* Enhanced Menu Items with Critical Sidebar Styling */
.menu-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   border-radius: 0.5rem;
   text-decoration: none;
   transition: all 0.15s ease;
   cursor: pointer;
   position: relative;
   /* Remove transitions to prevent blue flash during state changes */
   transition: none !important;
 }

/* Active State Styling - Enhanced with gradient and left border indicator */
.menu-item-active,
.sidebar .menu-item.mc-active,
.mc-admin-nav a.mc-active {
    background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
    color: #ffffff !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(234, 115, 81, 0.3) !important;
    /* Remove any transition that might cause blue flash */
    transition: none !important;
  }

/* Account dropdown active state styling */
.sidebar .menu-item-dropdown:has(.submenu .menu-item.mc-active) > a,
.sidebar .menu-item-dropdown:has(.submenu .menu-item.menu-item-active) > a {
    background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
    color: #ffffff !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(234, 115, 81, 0.3) !important;
    transition: none !important;
}

.sidebar .menu-item-dropdown:has(.submenu .menu-item.mc-active) > a .menu-item-icon,
.sidebar .menu-item-dropdown:has(.submenu .menu-item.menu-item-active) > a .menu-item-icon {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.sidebar .menu-item-dropdown:has(.submenu .menu-item.mc-active) > a .menu-item-text,
.sidebar .menu-item-dropdown:has(.submenu .menu-item.menu-item-active) > a .menu-item-text {
    color: #ffffff !important;
}

/* Fallback for browsers that don't support :has() pseudo-class */
.sidebar .menu-item-dropdown.mc-account-dropdown-active > a {
    background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
    color: #ffffff !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(234, 115, 81, 0.3) !important;
    transition: none !important;
}

.sidebar .menu-item-dropdown.mc-account-dropdown-active > a .menu-item-icon {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.sidebar .menu-item-dropdown.mc-account-dropdown-active > a .menu-item-text {
    color: #ffffff !important;
}

.menu-item-active::before,
.sidebar .menu-item.mc-active::before,
.mc-admin-nav a.mc-active::before {
   content: '' !important;
   position: absolute !important;
   left: -1.25rem !important;
   top: 50% !important;
   transform: translateY(-50%) !important;
   width: 4px !important;
   height: 60% !important;
   background: #E03274 !important;
   border-radius: 0 4px 4px 0 !important;
 }

.menu-item-active .menu-item-icon,
.sidebar .menu-item.mc-active .menu-item-icon,
.mc-admin-nav a.mc-active .menu-item-icon {
   color: #ffffff !important;
   fill: #ffffff !important;
 }

.menu-item-active .menu-item-text,
.sidebar .menu-item.mc-active .menu-item-text,
.mc-admin-nav a.mc-active .menu-item-text {
   color: #ffffff !important;
 }

/* Inactive State Styling */
.menu-item-inactive,
.sidebar .menu-item:not(.mc-active),
.mc-admin-nav a:not(.mc-active) {
   background-color: transparent !important;
   color: #6b7280 !important;
   /* Remove any transition that might cause blue flash */
   transition: none !important;
 }

/* Enhanced Hover State Styling */
.menu-item-inactive:hover,
.sidebar .menu-item:not(.mc-active):hover,
.mc-admin-nav a:not(.mc-active):hover {
   background-color: rgba(234, 115, 81, 0.1) !important;
   color: #ea7351 !important;
   transform: translateX(4px) !important;
 }

/* Dark Mode Hover Styling */
.dark .menu-item-inactive:hover,
.dark .sidebar .menu-item:not(.mc-active):hover,
.dark .mc-admin-nav a:not(.mc-active):hover {
   background-color: rgba(234, 115, 81, 0.15) !important;
   color: #ea7351 !important;
   transform: translateX(4px) !important;
 }

/* Dark Mode Active State Styling */
.dark .menu-item-active,
.dark .sidebar .menu-item.mc-active,
.dark .mc-admin-nav a.mc-active {
   background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
   color: #ffffff !important;
 }

.dark .sidebar .menu-item:not(.mc-active),
.dark .mc-admin-nav a:not(.mc-active) {
   color: #9ca3af !important;
 }

/* Enhanced Icon and Text Colors on Hover */
.sidebar .menu-item:hover .menu-item-icon,
.sidebar .menu-item:hover .menu-item-text {
   color: #ea7351 !important;
   fill: #ea7351 !important;
 }

.dark .sidebar .menu-item:hover .menu-item-icon,
.dark .sidebar .menu-item:hover .menu-item-text {
   color: #ea7351 !important;
   fill: #ea7351 !important;
 }

/* Critical Fix: Active menu item hover styling - ensure text and icons stay white */
.menu-item-active:hover,
.sidebar .menu-item.mc-active:hover,
.mc-admin-nav a.mc-active:hover {
   background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
   color: #ffffff !important;
 }

.menu-item-active:hover .menu-item-icon,
.menu-item-active:hover .menu-item-text,
.sidebar .menu-item.mc-active:hover .menu-item-icon,
.sidebar .menu-item.mc-active:hover .menu-item-text,
.mc-admin-nav a.mc-active:hover .menu-item-icon,
.mc-admin-nav a.mc-active:hover .menu-item-text {
   color: #ffffff !important;
   fill: #ffffff !important;
 }

/* Dark Mode Active Menu Item Hover Styling */
.dark .menu-item-active:hover,
.dark .sidebar .menu-item.mc-active:hover,
.dark .mc-admin-nav a.mc-active:hover {
   background: linear-gradient(135deg, #ea7351 0%, #E03274 100%) !important;
   color: #ffffff !important;
 }

.dark .menu-item-active:hover .menu-item-icon,
.dark .menu-item-active:hover .menu-item-text,
.dark .sidebar .menu-item.mc-active:hover .menu-item-icon,
.dark .sidebar .menu-item.mc-active:hover .menu-item-text,
.dark .mc-admin-nav a.mc-active:hover .menu-item-icon,
.dark .mc-admin-nav a.mc-active:hover .menu-item-text {
   color: #ffffff !important;
   fill: #ffffff !important;
 }

/* Submenu Active Item Hover Styling */
.sidebar .menu-item.mc-active .submenu .menu-item:hover,
.sidebar .menu-item.mc-active .submenu .menu-item:hover .menu-item-icon,
.sidebar .menu-item.mc-active .submenu .menu-item:hover .menu-item-text {
   background-color: rgba(234, 115, 81, 0.2) !important;
   color: #ffffff !important;
   fill: #ffffff !important;
 }

/* Prevent any blue backgrounds from appearing during transitions */
.sidebar .menu-item,
.mc-admin-nav a {
   /* Ensure no blue backgrounds can appear */
   background-color: transparent !important;
 }

/* Prevent any transition conflicts during state changes */
.sidebar .menu-item,
.sidebar .menu-item *,
.mc-admin-nav a,
.mc-admin-nav a * {
   transition-property: none !important;
   transition-duration: 0s !important;
   transition-delay: 0s !important;
 }

/* Active menu item hover styling - ensure text and icons stay white */
.menu-item-active:hover {
  background: var(--mc-gradient);
  color: #ffffff !important;
}

.menu-item-active:hover .menu-item-text {
  color: #ffffff !important;
}

.menu-item-active:hover .menu-item-icon {
  fill: #ffffff !important;
  color: #ffffff !important;
}

.dark .menu-item-active {
  background: var(--mc-gradient);
  color: #ffffff;
}

.dark .menu-item-inactive {
  color: #9ca3af;
}

.dark .menu-item-inactive:hover {
  background-color: var(--mc-secondary-hover);
  color: var(--mc-primary);
}

/* Ensure submenu items also have proper hover styling */
.menu-item-active .submenu .menu-item:hover {
  background-color: var(--mc-secondary-hover);
  color: #ffffff;
}

.menu-item-active .submenu .menu-item:hover .menu-item-text {
  color: #ffffff !important;
}

.menu-item-active .submenu .menu-item:hover .menu-item-icon {
  fill: #ffffff !important;
  color: #ffffff !important;
}

/* Prevent any blue backgrounds from appearing during transitions */
.menu-item,
.menu-item *,
.menu-item-text,
.menu-item-icon {
  /* Ensure no blue backgrounds can appear */
  background-color: transparent !important;
  /* Remove transitions to prevent blue flash */
  transition: none !important;
}

.menu-item-icon-active {
  fill: #ffffff;
}

.menu-item-icon-inactive {
  fill: #6b7280;
}

.menu-item-text {
  font-weight: 500;
  display: inline;
}

.sidebar.collapsed .menu-item-text {
  display: none;
}

/* Header Styles */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 99999;
  display: flex;
  width: 100%;
  border-bottom: 1px solid #e5e7eb;
  background-color: #ffffff;
}

/* Override main header background to white */
.mc-admin > .mc-header {
  background: white !important;
  padding-bottom: 0.25rem !important;
}

.dark .admin-header {
  border-bottom-color: #374151;
  background-color: #111827;
}

.header-content {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .header-content {
    flex-direction: row;
  }
}

.header-left {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem;
}

@media (min-width: 640px) {
  .header-left {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .header-left {
    justify-content: normal;
    border-bottom: 0;
    padding: 1rem 0;
  }
}

.dark .header-left {
  border-bottom-color: #374151;
}

/* Hamburger Menu */
.hamburger-btn {
  z-index: 99999;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

@media (min-width: 1024px) {
  .hamburger-btn {
    height: 2.75rem;
    width: 2.75rem;
  }
}

.dark .hamburger-btn {
  border-color: #374151;
  color: #9ca3af;
}

.hamburger-btn.active {
  background-color: #f3f4f6;
}

@media (min-width: 1024px) {
  .hamburger-btn.active {
    background-color: transparent;
  }
}

.dark .hamburger-btn.active {
  background-color: #374151;
}

.dark .hamburger-btn.active {
  background-color: transparent;
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
}

@media (min-width: 1024px) {
  .header-right {
    padding: 0;
  }
}

/* Theme Toggle with Masi Chat Brand Colors */
.theme-toggle {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.theme-toggle:hover {
  background-color: var(--mc-accent);
  color: var(--mc-primary);
  border-color: var(--mc-primary);
  transform: scale(1.05);
}

.dark .theme-toggle {
  color: #9ca3af;
}

.dark .theme-toggle:hover {
  background-color: rgba(234, 115, 81, 0.15);
  color: var(--mc-primary);
  border-color: var(--mc-primary);
}

/* Dark Mode Toggle Button Specific Styling - NUCLEAR SPECIFICITY */
.mc-dark-toggle {
    position: relative !important;
    overflow: hidden !important;
}

.mc-dark-toggle svg {
    transition: all 0.3s ease !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mc-dark-toggle:hover svg {
    transform: translate(-50%, -50%) rotate(15deg) scale(1.1) !important;
}

/* Ensure theme-toggle doesn't interfere with mc-dark-toggle */
.theme-toggle svg {
    position: relative !important;
    display: block !important;
}

/* User Profile Dropdown */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.user-avatar {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 50%;
}

.user-info {
  display: none;
  text-align: right;
}

@media (min-width: 1024px) {
  .user-info {
    display: block;
  }
}

.user-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
}

.dark .user-name {
  color: #ffffff;
}

.user-role {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 1rem;
  display: flex;
  width: 15rem;
  flex-direction: column;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark .dropdown-menu {
  border-color: #374151;
  background-color: #374151;
}

.dropdown-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
}

.dropdown-menu-item:hover {
  color: #3b82f6;
}

.dark .dropdown-menu-item {
  color: #d1d5db;
}

.dropdown-menu-logout {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1.25rem;
   font-size: 0.875rem;
   font-weight: 500;
   border-top: 1px solid #e5e7eb;
   cursor: pointer;
   background: none;
   border-left: none;
   border-right: none;
   border-bottom: none;
   width: 100%;
   text-align: left;
}

.dropdown-menu-logout:hover {
  color: #3b82f6;
}

.dark .dropdown-menu-logout {
  border-top-color: #374151;
}

/* Main Content Area */
.main-content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
  margin-left: 0;
}

@media (min-width: 1024px) {
  .main-content {
    margin-left: 290px;
  }
  
  .main-content.collapsed {
    margin-left: 90px;
  }
}

@media (max-width: 1023px) {
  .main-content {
    margin-left: 0 ;
  }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

/* Mobile Sidebar Positioning */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* No Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Responsive Utilities */
.lg\:static {
  position: static;
}

.lg\:translate-x-0 {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .lg\:static {
    position: static ;
  }
  
  .lg\:translate-x-0 {
    transform: translateX(0) ;
  }
  
  .lg\:block {
    display: block ;
  }
  
  .lg\:hidden {
    display: none ;
  }
}

/* Critical Sidebar Fixes - Override Conflicts */

/* Disable conflicting modern-header sidebar styles */
.mc-sidebar-collapsed .sidebar {
  transform: none ;
}

/* Ensure Alpine.js sidebar positioning works correctly */
.sidebar {
  position: fixed ;
  top: 0 ;
  left: 0 ;
  z-index: 9999 ;
  width: 290px ;
  height: 100vh ;
  transition: transform 0.3s ease ;
}

/* Mobile and Desktop responsive behavior */
@media (max-width: 1279px) {
  .sidebar {
    transform: translateX(-100%) ;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0) ;
  }
}

/* Desktop sidebar behavior */
@media (min-width: 1280px) {
  .sidebar {
    position: static ;
    transform: translateX(0) ;
  }
  
  .sidebar.collapsed {
    width: 90px ;
  }
}

/* Fix Alpine.js responsive classes */
.xl\:static {
  position: static ;
}

.xl\:translate-x-0 {
  transform: translateX(0) ;
}

.xl\:w-\[90px\] {
  width: 90px ;
}

/* Ensure sidebar toggle button works */
.mc-sidebar-toggle {
  display: flex ;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

@media (min-width: 1280px) {
  .mc-sidebar-toggle {
    display: none ;
  }
}

/* Fix menu item visibility in collapsed state */
.sidebar.collapsed .menu-item-text,
.sidebar.collapsed .menu-group-title {
  display: none ;
}

.sidebar.collapsed .menu-group-icon {
  display: block ;
  margin: 0 auto;
}

/* Dark Mode Enhancements */
.dark {
  --tw-bg-opacity: 1;
  --tw-text-opacity: 1;
}

/* Dark sidebar with enhanced styling */
.dark .sidebar {
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  border-right-color: #374151;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* Dark header with gradient */
.dark .mc-top-header {
  background: linear-gradient(90deg, #111827 0%, #1f2937 100%);
  border-bottom-color: #374151;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Dark main content area */
.dark .main-content {
  background: linear-gradient(135deg, #0f172a 0%, #111827 50%, #1e293b 100%);
  color: #e5e7eb;
}

/* Dark scrollbar styling */
.dark ::-webkit-scrollbar {
  width: 8px;
}

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
  background: var(--mc-primary);
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--mc-primary-hover);
}

/* Fix logo switching */
.sidebar .logo {
  display: block;
}

.sidebar .logo-icon {
  display: none;
}

.sidebar.collapsed .logo {
  display: none;
}

.sidebar.collapsed .logo-icon {
  display: block;
}

/* Critical Fix: Navigation Icon Display Issues */
.menu-item svg {
   flex-shrink: 0 !important;
   width: 24px !important;
   height: 24px !important;
 }

.menu-item-icon {
   flex-shrink: 0 !important;
   width: 24px !important;
   height: 24px !important;
 }

/* Ensure no text content leaks from SVG paths */
.menu-item svg path {
   pointer-events: none !important;
 }

/* Fix any font-family conflicts that might render SVG as text */
.menu-item svg {
   font-family: inherit !important;
 }

/* Aggressive Fix: Force clean icon display */
.menu-item {
   display: flex !important;
   align-items: center !important;
   gap: 0.625rem !important;
 }

.menu-item-icon {
   display: block !important;
   flex-shrink: 0 !important;
 }

.menu-item-text {
   display: block !important;
   flex-grow: 1 !important;
 }

/* Hide any pseudo-elements that might be adding content */
.menu-item::before,
.menu-item::after,
.menu-item-icon::before,
.menu-item-icon::after {
   display: none !important;
   content: none !important;
 }

/* Outlined sidebar icons for account, help, and chatbot */
#mc-account svg path,
#mc-chatbot svg path,
a[href="https://masichat.com/knowledge-base/"] svg path {
   fill: none !important;
   stroke: currentColor !important;
   stroke-width: 1.5 !important;
   stroke-linecap: round;
   stroke-linejoin: round;
}

/* -------------------------------------------------------------------
 * EXPANDED SIDEBAR DARK MODE LOGO
 * -------------------------------------------------------------------
 */

html.dark .sidebar .logo {
    background-image: url('../media/white-logo.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    height: 60px !important; /* Restore specific dimensions that made it visible */
    width: 200px !important; /* Restore specific dimensions that made it visible */
    display: block !important;
}

html.dark .sidebar .logo img {
    visibility: hidden !important; /* Hide visually but keep dimensions */
}

/* Ensure the expanded logo is hidden when sidebar is collapsed in dark mode */
html.dark .sidebar.collapsed .logo {
    display: none !important;
}

/* Ensure the collapsed logo icon is visible when sidebar is collapsed in dark mode */
html.dark .sidebar.collapsed .logo-icon {
    display: block !important;
}

/* Ensure the collapsed logo icon is hidden when sidebar is expanded in dark mode */
html.dark .sidebar .logo-icon {
    display: none !important;
}