/**
 * KwikMenu - Custom Styles
 * Modern, trendy design with premium feel
 */

/* Import Google Fonts for better typography */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* Base styles */
* {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-delay {
  animation: fadeIn 0.5s ease-out 0.3s forwards;
  opacity: 0;
}

.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

/* Splash screen styles */
#splash-screen {
  transition: opacity 0.5s ease-out;
}

.splash-logo {
  animation: slideUp 0.6s ease-out;
}

/* Premium Category Navigation */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Category buttons premium hover effect */
.category-btn {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.category-btn:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.category-btn.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3),
    0 2px 4px -1px rgba(249, 115, 22, 0.1);
}

.category-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(249, 115, 22, 0.4),
    0 4px 6px -1px rgba(249, 115, 22, 0.2);
}

.category-btn i {
  font-size: 1rem;
}

/* Menu item card modern effects */
.menu-item-card {
  position: relative;
  cursor: pointer;
}

.menu-item-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f97316, #dc2626);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.menu-item-card:hover::before {
  opacity: 0.1;
}

/* Menu item card hover effect */
.menu-item-card img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lazy loading image states */
img.lazy {
  opacity: 0;
  transition: opacity 0.4s ease-in;
}

img.lazy-loaded {
  opacity: 1;
}

/* Image placeholder with subtle animation */
.menu-item-card .lazy:not(.lazy-loaded) {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Search input focus enhancement */
#search-input:focus {
  transform: translateY(-1px);
}

/* Line clamp utility for description */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mark/highlight style for search results */
mark {
  background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
  color: inherit;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* Loading spinner enhancement */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Price badge styling */
.menu-item-card .text-orange-500 {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Badge icons */
.fas.fa-leaf,
.fas.fa-pepper-hot {
  font-size: 0.75rem;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

/* Mobile-first optimizations */
@media (max-width: 640px) {
  /* Optimize for mobile */
  .category-btn {
    font-size: 0.813rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Compact menu cards on mobile */
  .menu-item-card {
    margin-bottom: 0.5rem;
  }

  .layout-list .menu-card {
    height: 120px;
  }

  .layout-list .menu-card .relative {
    width: 120px;
  }
}

/* Tablet and desktop enhancements */
@media (min-width: 768px) {
  /* Add subtle animations on hover */
  .menu-item-card:hover {
    transform: translateY(-8px);
  }
}

/* Large screens - optimize layout */
@media (min-width: 1280px) {
  /* Better spacing for large screens */
  .max-w-7xl {
    max-width: 1400px;
  }
}

/* Print styles */
@media print {
  #splash-screen,
  #search-input,
  #categories-container,
  button {
    display: none !important;
  }

  .menu-item-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .menu-item-card {
    border: 2px solid currentColor;
  }

  .category-btn {
    border: 2px solid currentColor;
  }
}

/* Dark mode support (optional, for future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Uncomment if dark mode is desired
    body {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .bg-white {
        background-color: #374151;
    }
    
    .text-gray-800 {
        color: #f9fafb;
    }
    */
}

/* Empty state icon animation */
#empty-state .fa-search {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Error state icon animation */
#error-state .fa-exclamation-circle {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Sticky header shadow on scroll */
header.shadow-md {
  transition: box-shadow 0.2s ease-out;
}

/* Improved button states */
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.98);
}

/* Ensure proper spacing */
nav {
  position: relative;
}

/* Brand Logo Styles */
.brand-logo-container {
  background-color: white;
  transition: all 0.3s ease;
}

.brand-logo {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

/* Automatic shape detection/styling support */
/* Square/Circle logos usually fit well in square containers */
/* For wide logos, we might want to adjust the container width if needed, 
   but object-fit: contain handles it gracefully by letterboxing */

/* Footer spacing */
#app {
  padding-bottom: 3rem; /* Space for fixed footer */
}

/* Modal Animations */
.modal-enter {
  opacity: 0;
  transform: scale(0.95);
}

.modal-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.modal-exit {
  opacity: 1;
  transform: scale(1);
}

.modal-exit-active {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}

/* Card Hover Effects */
.menu-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Layout Switcher Styles */
.layout-btn.active {
  color: #f97316;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Layout: List View */
.layout-list .menu-card {
  display: flex;
  flex-direction: row;
  height: 140px;
}

.layout-list .menu-card .relative {
  width: 140px;
  height: 100%;
  flex-shrink: 0;
}

.layout-list .menu-card .p-5 {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.layout-list .menu-card .line-clamp-2 {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

/* Layout: Compact View */
.layout-compact .menu-card .relative {
  height: 120px;
}

.layout-compact .menu-card .p-5 {
  padding: 0.75rem;
}

.layout-compact .menu-card h3 {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.layout-compact .menu-card .text-lg {
  font-size: 0.875rem;
}

.layout-compact .menu-card p {
  display: none;
}

.layout-compact .menu-card .flex-wrap {
  display: none;
}
