@import "navigation.css";
@import "qr_print.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;
  }
}

*/
/* Marketing design color variables — swap in dark mode */
:root {
  /* warm palette */
  --warm-50: 254 252 248;
  --warm-100: 253 248 239;
  --warm-800: 45 36 24;
  --warm-900: 26 21 16;

  /* brand light tints */
  --brand-50: 255 248 240;
  --brand-100: 255 237 213;
  --brand-200: 254 215 170;
  --brand-300: 253 186 116;
}

html.dark {
  /* warm palette — inverted for dark backgrounds */
  --warm-50: 16 15 13;
  --warm-100: 24 22 18;
  --warm-800: 200 194 184;
  --warm-900: 232 228 220;

  /* brand light tints — darkened */
  --brand-50: 22 18 12;
  --brand-100: 36 28 16;
  --brand-200: 50 38 20;
  --brand-300: 70 50 24;
}

/* bg-white sections in dark mode (marketing page sections) */
html.dark section.bg-white,
html.dark div.bg-white {
  background-color: rgb(20 18 15) !important;
}

/* bg-green/red for flash messages in dark mode */
html.dark .bg-green-50 { background-color: rgb(20 30 20) !important; border-color: rgb(30 60 30) !important; }
html.dark .bg-red-50 { background-color: rgb(30 18 18) !important; border-color: rgb(60 30 30) !important; }
/* 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;
  }
}

/* Turbo preview frames must never flash a cached-open refund modal.
   The snapshot is also scrubbed via turbo:before-cache in orders_controller,
   but this covers any stale snapshot painted before Stimulus reconnects. */
html[data-turbo-preview] [data-orders-target="refundModal"] {
  display: none !important;
}
/*
 * QR Code Print Styles
 *
 * Rules for the off-screen print container used by the vendor dashboard
 * "QR Codes" section. This file MUST be loaded as a static stylesheet
 * (via @import in application.tailwind.css) — not as an inline <style>
 * block in the partial — because the dashboard sidebar loads section
 * partials via AJAX (`innerHTML = html`), and the document's CSP nonce
 * never matches a nonce regenerated per-AJAX-response. Static CSS bypasses
 * that mismatch entirely.
 *
 * Sizes are expressed in real inches, matching QrCodeGenerator::PRESETS. The
 * SVGs carry a viewBox, so an explicit in/width here scales the whole code
 * rather than padding it — which is what makes the printed result exactly the
 * advertised size no matter how many modules the URL needed.
 */

/* Keep the print container in the DOM but completely off-screen, so the
 * print-page variants never appear in normal view. The @media print
 * block below overrides position/left/top/width to bring it back on-page. */
#print-container {
  position: fixed;
  left: -100vw;
  top: 0;
  width: 100vw;
  pointer-events: none;
}

/* On-screen preview: the SVG ships with a physical width (e.g. 5in) so that
 * downloads open at the right size, which would blow out the dashboard card.
 * The viewBox lets us scale it back down to the container for display only. */
.qr-preview svg {
  width: 140px;
  height: 140px;
  display: block;
}

#print-container .qr-print-cell { text-align: center; }
#print-container .qr-print-title { font-weight: 700; margin: 0 0 0.12in; }
#print-container .qr-print-cta { font-weight: 600; margin: 0.12in 0 0; }
#print-container .qr-print-url { color: #555; margin: 0.04in 0 0; word-break: break-all; }

/* Per-preset QR dimensions — these are the numbers that make the label honest. */
#print-table_tent .qr-print-svg-wrap svg { width: 2in; height: 2in; }
#print-counter    .qr-print-svg-wrap svg { width: 3.5in; height: 3.5in; }
#print-window     .qr-print-svg-wrap svg { width: 5in; height: 5in; }
#print-large_sign .qr-print-svg-wrap svg { width: 7.5in; height: 7.5in; }

/* Supporting text scaled to its code so a table tent isn't shouting. */
#print-table_tent .qr-print-title { font-size: 12pt; }
#print-table_tent .qr-print-cta   { font-size: 10pt; }
#print-table_tent .qr-print-url   { font-size: 6pt; }

#print-counter .qr-print-title { font-size: 18pt; }
#print-counter .qr-print-cta   { font-size: 13pt; }
#print-counter .qr-print-url   { font-size: 8pt; }

#print-window .qr-print-title { font-size: 26pt; }
#print-window .qr-print-cta   { font-size: 18pt; }
#print-window .qr-print-url   { font-size: 10pt; }

#print-large_sign .qr-print-title { font-size: 32pt; }
#print-large_sign .qr-print-cta   { font-size: 22pt; }
#print-large_sign .qr-print-url   { font-size: 11pt; }

@media print {
  /* Letter portrait with a real margin; the 7.5in code is sized to fit inside
   * it, which is the largest a standard office printer can actually manage. */
  @page {
    size: letter portrait;
    margin: 0.4in;
  }

  /* Hide the app chrome outright rather than merely making it invisible.
   * `visibility: hidden` leaves the entire dashboard occupying layout space,
   * which is what used to emit trailing blank pages after every print job.
   * The Stimulus controller reparents #print-container to <body> before
   * printing so this rule can reach past it.
   *
   * Gated on `body.qr-printing`, which the controller sets only for the
   * duration of a QR print job. This stylesheet is global: ungated, the rule
   * would blank out every other print in the dashboard. */
  body.qr-printing > *:not(#print-container) {
    display: none !important;
  }

  body.qr-printing {
    background: #fff !important;
    margin: 0;
    padding: 0;
  }

  /* Always print on white with black ink, whatever theme the dashboard is in —
   * a QR on a warm-tinted background loses contrast, and the vendor is paying
   * for the toner. */
  #print-container {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    pointer-events: auto;
    background: #fff;
    color: #000;
  }

  /* Only the page the vendor actually asked for prints. Default-hidden rather
   * than default-shown so a stray Cmd+P can't spit out all four variants. */
  .print-page { display: none; }

  /* Single-code pages: one centred cell filling the sheet. */
  .print-page--window.is-printing,
  .print-page--large_sign.is-printing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 9.8in;
  }

  /* Table tents come six to a sheet — a vendor wants a stack of them, not six
   * separate print jobs. Two columns keeps each cell wider than the 2in code
   * so the cut lines have somewhere to go.
   *
   * The row height is the constraint that makes "6 per page" true: 3 rows plus
   * gaps has to stay inside the 10.2in of printable height a Letter page has
   * left after the 0.4in margins. Loosen the padding here and the sixth tent
   * silently falls onto page two. */
  .print-page--table_tent.is-printing {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 0.22in;
    align-content: start;
  }
  .print-page--table_tent .qr-print-cell {
    padding: 0.12in 0.1in;
  }
  .print-page--table_tent .qr-print-title { margin-bottom: 0.07in; }
  .print-page--table_tent .qr-print-cta { margin-top: 0.07in; }

  .print-page--counter.is-printing {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto);
    gap: 0.3in;
    align-content: center;
  }
  .print-page--counter .qr-print-cell {
    padding: 0.15in;
  }

  /* Dashed cut lines, on the sheets where there's more than one to cut apart. */
  .print-page--table_tent .qr-print-cell,
  .print-page--counter .qr-print-cell {
    border: 1px dashed #bbb;
    break-inside: avoid;
  }

  /* Soft edges are what kills a scan. */
  .qr-print-svg-wrap svg {
    shape-rendering: crispEdges;
  }
}
/* Printable customer-facing sign (admin -> vendor).
 *
 * This is a physical object, so the units are physical. `@page` is Letter with
 * no margin and the sheet is an exact 8.5x11in box: the printer's own margins
 * are what the padding inside the sheet is for. Print at 100% scale -- "fit to
 * page" shrinks the QR and the sizes below stop being true.
 *
 * Warm brand palette, not the admin's blue: what a customer sees taped to a
 * serving window is a customer-facing surface, and it should read like one.
 *
 * Static stylesheet rather than an inline <style> so it stays cacheable and
 * matches qr_print.css, which has to be static for CSP reasons.
 */

:root {
  --sign-orange: #FF8C00;
  --sign-orange-dark: #EA580C;
  --sign-ink: #1C1917;
  --sign-muted: #78716C;
  --sign-paper: #FFFFFF;
}

/* Screen-only chrome: a toolbar and a desk to put the sheet on, so an admin
 * can see what they are about to send before they send it. */
body.qr-sign-body {
  margin: 0;
  background: #E7E5E4;
  font-family: 'Poppins', 'Inter var', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--sign-ink);
}

.sign-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #1C1917;
  color: #fff;
}

.sign-toolbar__title { font-weight: 600; font-size: 0.95rem; margin-right: auto; }
.sign-toolbar__hint { font-size: 0.8rem; color: #A8A29E; width: 100%; }

.sign-toolbar a,
.sign-toolbar button {
  /* 44px minimum target: admins do this from a phone in the field too. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid #57534E;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.sign-toolbar a.is-active { background: #fff; color: #1C1917; border-color: #fff; }
.sign-toolbar button.sign-toolbar__print { background: var(--sign-orange); border-color: var(--sign-orange); font-weight: 600; }

.sign-stage { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 1.5rem 1rem 3rem; }

/* --- The sheet ------------------------------------------------------------ */

.sign-sheet {
  box-sizing: border-box;
  width: 8.5in;
  height: 11in;
  background: var(--sign-paper);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* One sign filling the page (window + large). */
.sign-panel {
  box-sizing: border-box;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.6in;
}

.sign-head, .sign-foot { display: flex; flex-direction: column; align-items: inherit; }
.sign-mark { display: flex; align-items: center; justify-content: center; gap: 0.12in; margin-bottom: 0.22in; }
.sign-mark img { width: 0.6in; height: 0.6in; object-fit: contain; }
.sign-mark span { font-size: 26pt; font-weight: 700; letter-spacing: -0.01em; }

.sign-headline {
  margin: 0 0 0.28in;
  font-size: 40pt;
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.sign-headline em { font-style: normal; color: var(--sign-orange-dark); display: block; }

/* The code sits on plain white with room around it. Nothing decorative goes
 * near it -- artwork crowding a QR is the classic reason one stops scanning. */
.sign-code { line-height: 0; margin: 0 0 0.24in; }
.sign-code svg { display: block; }

.sign-steps {
  display: flex;
  justify-content: center;
  gap: 0.3in;
  margin: 0 0 0.26in;
  padding: 0;
  list-style: none;
}
.sign-steps li { display: flex; align-items: center; gap: 0.09in; font-size: 12pt; font-weight: 500; }
.sign-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.26in;
  height: 0.26in;
  border-radius: 50%;
  background: var(--sign-orange);
  color: #fff;
  font-size: 10pt;
  font-weight: 700;
}

.sign-truck { margin: 0; font-size: 21pt; font-weight: 700; letter-spacing: -0.01em; }
.sign-url { margin: 0.06in 0 0; font-size: 11pt; color: var(--sign-muted); }

/* --- Large sign: fewer words, bigger code -------------------------------- */

.sign--large_sign .sign-panel { padding: 0.4in; }
.sign--large_sign .sign-headline { font-size: 32pt; margin-bottom: 0.18in; }
.sign--large_sign .sign-mark { margin-bottom: 0.14in; }
.sign--large_sign .sign-mark img { width: 0.5in; height: 0.5in; }
.sign--large_sign .sign-mark span { font-size: 22pt; }
.sign--large_sign .sign-code { margin-bottom: 0.16in; }
.sign--large_sign .sign-truck { font-size: 18pt; }

/* --- Counter card: two per sheet, code beside the words ------------------- */

.sign--counter_card .sign-panel {
  /* Code on the left, words on the right. Grid rather than flex so head and
   * foot stack beside a code that spans both rows. */
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "code head" "code foot";
  align-content: center;
  justify-content: center;
  column-gap: 0.45in;
  text-align: left;
  padding: 0.5in 0.7in;
  height: 5.5in;
  flex: 0 0 5.5in;
}
.sign--counter_card .sign-panel + .sign-panel { border-top: 1px dashed #D6D3D1; }
.sign--counter_card .sign-head { grid-area: head; align-self: end; }
.sign--counter_card .sign-code { grid-area: code; align-self: center; margin: 0; }
.sign--counter_card .sign-foot { grid-area: foot; align-self: start; padding-top: 0.14in; }
.sign--counter_card .sign-mark { justify-content: flex-start; }
.sign--counter_card .sign-mark { margin-bottom: 0.16in; }
.sign--counter_card .sign-mark img { width: 0.42in; height: 0.42in; }
.sign--counter_card .sign-mark span { font-size: 18pt; }
.sign--counter_card .sign-headline { font-size: 26pt; margin-bottom: 0.16in; }
.sign--counter_card .sign-steps { flex-direction: column; gap: 0.09in; margin-bottom: 0.18in; }
.sign--counter_card .sign-steps li { font-size: 11pt; }
.sign--counter_card .sign-truck { font-size: 16pt; }
.sign--counter_card .sign-url { font-size: 9.5pt; }

/* --- Print ---------------------------------------------------------------- */

/* NOTE: the `@page` rule for this sheet lives in layouts/qr_sign.html.erb, not
 * here. `require_tree .` sweeps this file into application.css, and `@page`
 * cannot be scoped to a selector -- declared here it would override the
 * dashboard's own 0.4in QR print margin (qr_print.css) on every other page.
 * The sign layout is the only place that rule may safely apply. */

@media print {
  .sign-toolbar, .sign-stage__hint { display: none !important; }

  body.qr-sign-body { background: #fff; }
  .sign-stage { display: block; padding: 0; }

  /* Orange is the whole point of a branded sign; browsers drop background
   * colour by default when printing. Scoped to this page -- ungated it would
   * change how every other print surface in the app renders. */
  .qr-sign-body * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  .sign-sheet { box-shadow: none; width: 8.5in; height: 11in; page-break-after: always; }
  .sign-sheet:last-child { page-break-after: auto; }
}

/* Small screens: let the sheet scale down rather than force a sideways scroll.
 * Print output is unaffected -- the @page block above owns that. */
@media screen and (max-width: 9in) {
  .sign-stage { padding: 1rem 0.5rem 2rem; }
  .sign-sheet { transform: scale(var(--sign-scale, 0.42)); transform-origin: top center; margin-bottom: calc((var(--sign-scale, 0.42) - 1) * 11in); }
}
/*
 * 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.
 *


 */
