/* Custom CSS for Login Page & Main Layout */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap");

body {
  font-family: "Sarabun", "Inter", sans-serif;
}

/* Force body and layout to stay within viewport and prevent entire page horizontal scroll */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}
.admin-layout {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* Smooth transitions for sidebar toggle */
.sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, border-color 0.3s !important;
}
.main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

/* Desktop Collapsed state */
.collapsed-sidebar .sidebar {
  transform: translateX(-240px) !important;
}
.collapsed-sidebar .main-content {
  margin-left: 0 !important;
}

/* Mobile Drawer Overlay Backdrop */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive rules for mobile screen toggle */
@media (max-width: 768px) {
  .dashboard-content {
    padding: 16px 12px !important;
  }
  .top-header {
    padding: 16px 12px !important;
  }
  .sidebar {
    transform: translateX(-240px) !important;
    display: flex !important; /* Override display: none from admin.css */
    z-index: 50 !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  
  /* Mobile Open Drawer state */
  .mobile-sidebar-open .sidebar {
    transform: translateX(0) !important;
  }
  .mobile-sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Sidebar Menu Categories */
.menu-category {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 6px;
  padding-left: 14px;
  opacity: 0.8;
}
.menu-category:first-of-type {
  margin-top: 4px;
}

/* Minimalist Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3); /* Semi-transparent Slate-400 thumb */
  border-radius: 10px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* Firefox scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}
