/* Custom Styles */

:root {
  --transition-speed: 0.3s;
}

/* Root styles - Smooth scrolling & fixed layout */
html {
  scroll-behavior: smooth;
  height: 100dvh; /* Dynamic viewport height for mobile */
}

body {
  position: fixed;
  inset: 0; /* Top, right, bottom, left all 0 */
  overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */

aside {
  transition: transform 0.3s ease;
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}

/* Theme label toggle */
.theme-label-light {
  display: inline;
}

.theme-label-dark {
  display: none;
}

html[data-theme="business"] .theme-label-light {
  display: none;
}

html[data-theme="business"] .theme-label-dark {
  display: inline;
}

aside.sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 16rem;
  height: 100dvh;
  overflow: hidden;
}

/* Scrollable menu content */
aside.sidebar > div:nth-child(2) {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fixed footer sections - with safe area */
aside.sidebar > div:nth-child(3),
aside.sidebar > div:nth-child(4),
aside.sidebar > div:nth-child(5) {
  flex-shrink: 0;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Desktop: sidebar becomes relative */
@media (min-width: 1024px) {
  aside.sidebar {
    position: relative;
    z-index: auto;
  }
}

/* ============================================
   Main Content
   ============================================ */

main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
  height: 100%;
}

/* Alpine.js x-cloak - prevent flash */
[x-cloak] {
  display: none !important;
}

aside[x-cloak] {
  display: none;
}

@media (min-width: 1024px) {
  aside[x-cloak] {
    display: flex;
  }
}

/* Summary active state */
#mainSidebar details > summary:active {
  background: none;
}

/* ============================================
   Animations
   ============================================ */

/* Custom animations */
.fade-in {
  animation: fadeIn var(--transition-speed) ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in animation */
.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: currentColor;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive cards */
@media (max-width: 768px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* Mobile menu items */
@media (max-width: 640px) {
  .menu li a {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Smooth transitions for all interactive elements */
button,
a,
.btn {
  transition: all 0.2s ease;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
  .btn-sm {
    min-height: 2.5rem;
    min-width: 2.5rem;
  }
}

/* ============================================
   DaisyUI Modal - Restaurant Panel Custom Overrides
   ============================================ */

/* Prevent modal content overflow */
.modal-box {
  max-height: 90vh;
  overflow-y: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .modal-box {
    width: 95vw;
    max-width: 100%;
    max-height: 85vh;
  }

  .modal-action {
    flex-direction: column;
  }

  .modal-action .btn {
    width: 100%;
  }
}
