@import "navigation.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
  .line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  
  .aspect-square {
    aspect-ratio: 1 / 1;
  }
}

@layer components {
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }

  /* Exciting hero gradient system */
  .bg-radial-gradient-to-center {
    background: radial-gradient(ellipse at center, transparent 0%, transparent 40%, rgba(0,0,0,0.1) 100%);
  }
  
  /* Enhanced hero animations */
  @keyframes hero-glow {
    0%, 100% {
      opacity: 0.8;
      transform: scale(1);
    }
    50% {
      opacity: 1;
      transform: scale(1.02);
    }
  }
  
  @keyframes gradient-shift {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }
  
  /* Orange brand gradient animation */
  .hero-animated-gradient {
    background: linear-gradient(-45deg, 
      theme(colors.orange.400), 
      theme(colors.orange.500), 
      theme(colors.red.500), 
      theme(colors.orange.600),
      theme(colors.amber.500)
    );
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
  }
  
  /* Dark mode hero adjustments */
  .dark .hero-animated-gradient {
    background: linear-gradient(-45deg, 
      theme(colors.orange.500), 
      theme(colors.orange.600), 
      theme(colors.red.600), 
      theme(colors.orange.700),
      theme(colors.amber.600)
    );
  }
  
  /* Hero text enhancements */
  .hero-text-glow {
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 0.5),
      0 0 40px rgba(255, 215, 0, 0.3),
      0 0 60px rgba(255, 165, 0, 0.2);
  }
  
  .dark .hero-text-glow {
    text-shadow: 
      0 0 20px rgba(255, 215, 0, 0.6),
      0 0 40px rgba(255, 165, 0, 0.4),
      0 0 60px rgba(255, 140, 0, 0.3);
  }
  
  /* SortableJS styles for drag and drop */
  .sortable-ghost {
    opacity: 0.4;
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
    border-radius: 0.5rem;
  }
  
  .sortable-chosen {
    transform: rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
  }
  
  .sortable-drag {
    opacity: 1;
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    z-index: 1000;
  }
  
  .dark .sortable-ghost {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
  }
}

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/* Menu Builder Styles */

/* Smooth transitions for interactive elements */
.menu-builder-transition {
  transition: all 0.2s ease-in-out;
}

/* Category expand/collapse animation */
[data-controller="menu-category"] [data-menu-category-target="itemsList"] {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Drag and drop visual feedback */
.menu-item-dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.menu-item-drag-over {
  border-top: 3px solid #3B82F6;
}

/* Preview panel styling */
.menu-preview-item {
  transition: transform 0.2s ease-in-out;
}

.menu-preview-item:hover {
  transform: translateY(-2px);
}

/* Modal animations */
[data-menu-builder-target="itemModal"]:not(.hidden) {
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tutorial card animation */
[data-menu-builder-target="tutorial"] {
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress indicator styling */
.progress-step {
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 100px;
  height: 2px;
  background-color: #E5E7EB;
  transform: translateY(-50%);
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.completed::after {
  background-color: #10B981;
}

/* SortableJS Drag and Drop Styles */
.sortable-ghost {
  opacity: 0.4;
  background-color: #f3f4f6;
  border: 2px dashed #9ca3af;
}

.sortable-chosen {
  transform: scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
  z-index: 1000;
}

.sortable-drag {
  opacity: 1;
  transform: rotate(2deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Dark mode support for sortable states */
@media (prefers-color-scheme: dark) {
  .sortable-ghost {
    background-color: #374151;
    border-color: #6b7280;
  }
  
  .sortable-chosen {
    border-color: #60a5fa;
  }
}

/* Item drag handle styles */
.item-drag-handle {
  transition: all 0.2s ease-in-out;
}

.item-drag-handle:hover {
  transform: scale(1.1);
}

/* Visual feedback for cross-category drops */
[data-menu-category-target="itemsList"].sortable-drop-target {
  background-color: #eff6ff;
  border: 2px dashed #3b82f6;
  border-radius: 0.5rem;
  min-height: 60px;
  padding: 1rem;
}

/* Dark mode for cross-category drops */
@media (prefers-color-scheme: dark) {
  [data-menu-category-target="itemsList"].sortable-drop-target {
    background-color: #1e3a8a20;
    border-color: #60a5fa;
  }
}

/* Help section transitions */
[data-menu-builder-target="helpContent"],
[data-menu-builder-target="modifierHelpContent"] {
  transition: all 0.3s ease-in-out;
}

[data-menu-builder-target="helpToggleIcon"],
[data-menu-builder-target="modifierHelpToggleIcon"] {
  transition: transform 0.3s ease-in-out;
}

/* Help section hover effects */
[data-action="click->menu-builder#toggleHelp"]:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

[data-action="click->menu-builder#toggleModifierHelp"]:hover {
  background-color: rgba(34, 197, 94, 0.05);
}

@media (prefers-color-scheme: dark) {
  [data-action="click->menu-builder#toggleHelp"]:hover {
    background-color: rgba(59, 130, 246, 0.1);
  }
  
  [data-action="click->menu-builder#toggleModifierHelp"]:hover {
    background-color: rgba(34, 197, 94, 0.1);
  }
}
/* Menu Reorder Drag and Drop Styles */

/* Dragging item styles */
.dragging {
  opacity: 0.6 !important;
  transform: rotate(2deg) scale(1.05);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2) !important;
  z-index: 1000 !important;
  position: relative !important;
  cursor: grabbing !important;
}

/* Dark mode dragging styles */
.dark .dragging {
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Drop zone active styles */
.drop-zone-active {
  background-color: rgba(59, 130, 246, 0.1);
  border: 2px dashed rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Dark mode drop zone styles */
.dark .drop-zone-active {
  background-color: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.7);
}

/* Drop target item styles */
.drop-target-active {
  border: 2px solid rgba(59, 130, 246, 0.8) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  transition: all 0.2s ease;
}

/* Dark mode drop target styles */
.dark .drop-target-active {
  border-color: rgba(59, 130, 246, 0.9) !important;
  background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Menu items container styling */
.menu-items {
  min-height: 120px;
  transition: all 0.2s ease;
}

/* Individual menu item styling */
[data-menu-reorder-target="item"] {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-menu-reorder-target="item"]:hover:not(.dragging) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark mode hover effects */
.dark [data-menu-reorder-target="item"]:hover:not(.dragging) {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Category section styling */
.category-section {
  transition: all 0.2s ease;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0.5rem 0;
}

/* Visual feedback for empty categories during drag */
.category-section.drop-zone-active .menu-items:empty::before {
  content: "Drop menu item here";
  display: block;
  text-align: center;
  padding: 2rem;
  color: #6B7280;
  font-style: italic;
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  background-color: #F9FAFB;
}

.dark .category-section.drop-zone-active .menu-items:empty::before {
  color: #9CA3AF;
  border-color: #374151;
  background-color: #1F2937;
}

/* Dragging cursor for the entire page when dragging */
body.dragging-active {
  cursor: grabbing !important;
}

/* Drag handle styling - optimized for touch */
.drag-handle {
  opacity: 0.7;
  cursor: grab;
  transition: all 0.2s ease;
  touch-action: none; /* Prevent scrolling when dragging */
  user-select: none; /* Prevent text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle {
  pointer-events: auto;
  cursor: grab !important;
}

.drag-handle:active {
  cursor: grabbing !important;
}

/* Ensure drag handle works on touch devices */
@media (pointer: coarse) {
  .drag-handle {
    opacity: 0.8; /* More visible on touch devices */
    padding: 0.75rem; /* Larger touch target */
  }
}

/* Menu item cursor states - only for app-managed menus */
[data-menu-reorder-app-managed-value="true"] [data-menu-reorder-target="item"]:not(.dragging) {
  cursor: grab !important;
}

[data-menu-reorder-app-managed-value="true"] [data-menu-reorder-target="item"]:active:not(.dragging) {
  cursor: grabbing !important;
}

/* Error notification styling */
.error-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: #EF4444;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
  z-index: 50;
  max-width: 300px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Success notification styling */
.success-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: #10B981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
  z-index: 50;
  max-width: 300px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Drag placeholder space styling */
.drag-placeholder-space {
  display: block;
  flex-shrink: 0;
  transition: all 0.2s ease;
  opacity: 0.8;
  animation: placeholderPulse 2s ease-in-out infinite;
}

/* Dark mode drag placeholder space */
.dark .drag-placeholder-space {
  background-color: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.7) !important;
}

/* Subtle pulse animation for placeholder */
@keyframes placeholderPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
} 
/*
 * Navigation Styles
 *
 * Responsive sidebar and navigation component styles.
 * Works in conjunction with theme_helper.rb and sidebar_controller.js
 *
 * Design: Apple/Jony Ive inspired - generous spacing, subtle interactions
 */

/* ================================
   Sidebar Base Styles
   ================================ */

.sidebar {
  /* Desktop: Optimal reading width */
  width: 15rem; /* 240px - slightly wider for breathing room */
  min-width: 15rem;
  max-width: 15rem;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
}

/* Collapsed state (icons only) */
.sidebar.sidebar-collapsed {
  width: 4.5rem !important; /* 72px - slightly wider for better icon spacing */
  min-width: 4.5rem !important;
  max-width: 4.5rem !important;
}

/* Hide text in collapsed state */
.sidebar.sidebar-collapsed .sidebar-text {
  display: none !important;
}

/* Center icons when collapsed */
.sidebar.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* ================================
   Active State (Blue highlight)
   ================================ */

.sidebar-link.active {
  @apply bg-blue-600 text-white dark:bg-blue-500 shadow-sm;
}

.sidebar-link.active:hover {
  @apply bg-blue-700 dark:bg-blue-600;
}

/* First section header needs less top spacing */
nav[aria-label="Sidebar"] > div:first-child {
  padding-top: 0.25rem !important;
}

/* ================================
   Responsive Breakpoints
   ================================ */

/* Mobile: Overlay mode (hidden by default) */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 17rem; /* 272px for comfortable mobile overlay */
    max-width: 17rem;
    min-width: 17rem;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    z-index: 50;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Always show text on mobile (it's an overlay) */
  .sidebar .sidebar-text {
    display: inline !important;
  }
}

/* Tablet Portrait: Compact sidebar (icons only, hover to expand) */
@media (min-width: 768px) and (max-width: 1023px) {
  .sidebar {
    width: 4.5rem; /* 72px collapsed - room for icons */
    min-width: 4.5rem;
    max-width: 4.5rem;
  }

  .sidebar .sidebar-text {
    display: none;
  }

  .sidebar .sidebar-link {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Expand on hover for tablet */
  .sidebar:hover {
    width: 15rem;
    max-width: 15rem;
    min-width: 15rem;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1),
                0 8px 10px -6px rgb(0 0 0 / 0.1);
  }

  .sidebar:hover .sidebar-text {
    display: inline;
  }

  .sidebar:hover .sidebar-link {
    justify-content: flex-start;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Tablet Landscape: Same as tablet portrait */
@media (min-width: 1024px) and (max-width: 1179px) {
  .sidebar {
    width: 4.5rem;
    min-width: 4.5rem;
    max-width: 4.5rem;
  }

  .sidebar .sidebar-text {
    display: none;
  }

  .sidebar .sidebar-link {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sidebar:hover {
    width: 15rem;
    max-width: 15rem;
    min-width: 15rem;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1),
                0 8px 10px -6px rgb(0 0 0 / 0.1);
  }

  .sidebar:hover .sidebar-text {
    display: inline;
  }

  .sidebar:hover .sidebar-link {
    justify-content: flex-start;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Desktop: Full sidebar */
@media (min-width: 1180px) {
  .sidebar {
    width: 15rem;
    min-width: 15rem;
    max-width: 15rem;
  }

  .sidebar .sidebar-text {
    display: inline;
  }

  /* Manual collapse on desktop */
  .sidebar.sidebar-collapsed {
    width: 4.5rem !important;
    min-width: 4.5rem !important;
    max-width: 4.5rem !important;
  }

  .sidebar.sidebar-collapsed .sidebar-text {
    display: none !important;
  }

  .sidebar.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* ================================
   Backdrop for Mobile Overlay
   ================================ */

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ================================
   Main Content Area
   ================================ */

.sidebar-main-content {
  flex: 1;
  min-width: 0;
  transition: margin-left 300ms ease-out;
}

/* Mobile: Full width */
@media (max-width: 767px) {
  .sidebar-main-content {
    margin-left: 0;
  }
}

/* Tablet: Compact sidebar offset */
@media (min-width: 768px) and (max-width: 1179px) {
  .sidebar-main-content {
    margin-left: 4rem; /* 64px */
  }
}

/* Desktop: Full sidebar offset */
@media (min-width: 1180px) {
  .sidebar-main-content {
    margin-left: 0; /* Using flex, no margin needed */
  }
}

/* ================================
   Accessibility: Reduced Motion
   ================================ */

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop,
  .sidebar-main-content {
    transition: none;
  }
}

/* ================================
   Touch Target Sizing
   ================================ */

/* Ensure minimum 44x44px touch targets (Apple HIG) */
.sidebar-link {
  min-height: 48px;
  touch-action: manipulation;
}

/* ================================
   Scrollbar Styling (for sidebar)
   ================================ */

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgb(156 163 175 / 0.5);
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgb(156 163 175 / 0.8);
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
  .sidebar::-webkit-scrollbar-thumb {
    background-color: rgb(75 85 99 / 0.5);
  }

  .sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgb(75 85 99 / 0.8);
  }
}

/* ================================
   Keyboard Focus Styles
   ================================ */

/* Clear focus ring for keyboard navigation */
.sidebar-link:focus-visible {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* Ensure focus is visible in collapsed state */
.sidebar.sidebar-collapsed .sidebar-link:focus-visible {
  outline-offset: 0;
}

/* Dark mode focus ring */
.dark .sidebar-link:focus-visible {
  outline-color: rgb(96 165 250);
}

/* Hide default focus outline, show focus-visible */
.sidebar-link:focus {
  outline: none;
}

/* Navigation links focus */
nav a:focus-visible,
nav button:focus-visible {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .sidebar-link:focus-visible,
  nav a:focus-visible,
  nav button:focus-visible {
    outline: 3px solid CanvasText;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
