/* GJ Steel Truck Queue System - Styles */
/* Multi-tenant theme support with CSS Variables */

/* CSS Variables for Theme Colors - Set dynamically by config.js */
:root {
  --color-primary: #1e3a8a;        /* GJ/GS theme */
  --color-secondary: #3b82f6;     /* Default: Light Blue */
  --color-accent: #60a5fa;        /* Default: Lighter Blue */
  --color-text: #1f2937;          /* Default: Dark Gray */
  --color-bg-start: #eff6ff;      /* Default: Very Light Blue */
  --color-bg-mid: #dbeafe;        /* Default: Light Blue */
  --color-bg-end: #bfdbfe;        /* Default: Medium Light Blue */
  
  /* Helper: Convert hex to RGB for rgba() usage */
  --color-primary-rgb: 30, 58, 138;
  --color-secondary-rgb: 59, 130, 246;

  /* QR: พื้นหลังขาวเป็นไฟล์ภาพจริง — ธีมมืดไม่ recolor */
  --qr-white-bg: url("../img/white-tile.png");
  /* QR: พื้นหลังเทาอ่อนเป็นไฟล์ภาพจริง — กัน forced dark mode */
  --qr-gray-bg: url("../img/gray-tile.png");
}

/* Theme-aware Utility Classes - Use these instead of Tailwind blue classes */
.text-primary { color: var(--color-primary) !important; }
.text-primary-light { color: var(--color-secondary) !important; }
.text-primary-dark { color: var(--color-primary) !important; }
.text-primary-700 { color: var(--color-primary) !important; }
.text-primary-900 { color: var(--color-primary) !important; }
.text-primary-100 { color: var(--color-bg-start) !important; }

.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-light { background-color: var(--color-secondary) !important; }
.bg-primary-50 { background-color: var(--color-bg-start) !important; }
.bg-primary-100 { background-color: var(--color-bg-mid) !important; }
.bg-primary-700 { background-color: var(--color-primary) !important; }
.bg-primary-500 { background-color: var(--color-secondary) !important; }
.bg-primary-600 { background-color: var(--color-secondary) !important; }
.bg-primary-800 { background-color: var(--color-primary) !important; }

.border-primary { border-color: var(--color-primary) !important; }
.border-primary-200 { border-color: var(--color-bg-mid) !important; }
.border-primary-600 { border-color: var(--color-secondary) !important; }
.border-primary-700 { border-color: var(--color-primary) !important; }

.bg-gradient-to-r-primary {
  background: linear-gradient(to right, var(--color-bg-start), var(--color-bg-mid)) !important;
}

.bg-gradient-to-br-primary {
  background: linear-gradient(to bottom right, var(--color-primary), var(--color-secondary)) !important;
}

.bg-gradient-to-r-primary-button {
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary)) !important;
}

.bg-gradient-to-r-primary-button-hover {
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary)) !important;
}

.hover\:border-primary-600:hover { border-color: var(--color-secondary) !important; }
.hover\:from-primary-800:hover { --tw-gradient-from: var(--color-primary) !important; }
.hover\:to-primary-600:hover { --tw-gradient-to: var(--color-secondary) !important; }

/* Additional utility classes for better theme support */
.text-primary-600 { color: var(--color-secondary) !important; }

/* Base Styles */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: 'Noto Sans Thai', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  position: relative;
}

* {
  font-family: 'Noto Sans Thai', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
}

*:not(svg):not(path) {
  max-width: 100%;
}

/* Gradients - Using CSS Variables */
.gradient-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.gradient-bg {
  background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-mid) 50%, var(--color-bg-end) 100%);
  position: relative;
}

.gradient-bg::before {
  pointer-events: none;
  z-index: 0;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(var(--color-primary-rgb), 0.03) 40px, rgba(var(--color-primary-rgb), 0.03) 80px),
    repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(var(--color-secondary-rgb), 0.03) 40px, rgba(var(--color-secondary-rgb), 0.03) 80px);
  opacity: 0.6;
}

/* Form Container */
.form-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 
    0 25px 70px rgba(var(--color-primary-rgb), 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 0 2px 2px rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

/* Input Fields */
.input-field {
  transition: all 0.3s ease;
  border: 2px solid #e5e7eb;
  font-size: 1.25rem;
}

.input-field:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(var(--color-secondary-rgb), 0.12);
  transform: translateY(-2px);
}

/* Date Input */
.date-input-wrapper {
  position: relative;
}

.date-input-wrapper input[type="date"] {
  cursor: pointer;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  /* ลบ absolute positioning และ full width/height ออก */
  /* เพื่อไม่ให้ทั้ง input กลายเป็นปุ่มเปิด calendar */
  /* ทำให้ปุ่ม date picker มีขนาดปกติเท่านั้น */
}

/* Submit Button */
.btn-submit {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  transition: left 0.3s ease;
}

.btn-submit:hover::before {
  left: 0;
}

.btn-submit span {
  position: relative;
  z-index: 1;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(var(--color-primary-rgb), 0.45);
}

.btn-submit:active {
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 7px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(35px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { transform: scale(0.25); opacity: 0; }
  50% { transform: scale(1.08); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.7s ease forwards;
}

.animate-slide-down {
  animation: slideDown 0.6s ease forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Icon Wrapper */
.icon-wrapper {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.75));
  backdrop-filter: blur(12px);
}

/* Labels */
label {
  font-weight: 600;
  color: #374151;
  font-size: 1.15rem;
}

.required::after {
  content: ' *';
  color: #ef4444;
}

.field-icon {
  color: var(--color-secondary);
  pointer-events: none;
}

/* Time Slot Buttons */
.time-slot-btn {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid #e5e7eb;
  font-size: 1.1rem;
  background: white;
  position: relative;
  overflow: hidden;
}

.time-slot-btn:hover:not(:disabled) {
  border-color: var(--color-secondary);
  background-color: var(--color-bg-start);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(var(--color-secondary-rgb), 0.28);
}

.time-slot-btn.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(var(--color-primary-rgb), 0.45);
}

.time-slot-btn.active .slot-content {
  color: white;
}

.time-slot-btn.active .slot-content .text-gray-800 {
  color: white !important;
}

.time-slot-btn.active .slot-content .text-gray-600 {
  color: rgba(255, 255, 255, 0.92) !important;
}

.time-slot-btn.active .slot-content svg {
  color: white !important;
}

.time-slot-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: #f3f4f6;
  transform: none;
}

.time-slot-btn.full {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  opacity: 0.75;
}

.slot-content {
  position: relative;
  z-index: 1;
}

/* Tab Navigation */
.tab-btn {
  position: relative;
  transition: all 0.25s ease;
  font-size: 1.1rem;
}

.tab-btn.active {
  color: var(--color-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: 4px 4px 0 0;
}

#tab-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#tab-nav::-webkit-scrollbar {
  display: none;
}

#app {
  overflow-x: hidden;
}

/* Radio Buttons */
.queue-type-radio:checked + div {
  border-color: var(--color-primary) !important;
  background-color: var(--color-bg-start) !important;
  box-shadow: 0 12px 35px rgba(var(--color-primary-rgb), 0.22) !important;
  transform: translateY(-2px);
}

/* Ensure background color is applied even with bg-white class */
.queue-type-radio:checked + div.bg-white {
  background-color: var(--color-bg-start) !important;
}

.queue-type-radio:checked + div .checked-dot {
  display: block !important;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  top: 25px;
  right: 25px;
  z-index: 10000;
  max-width: 420px;
  animation: slideInRight 0.35s ease;
  font-size: 1.1rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(450px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(450px);
    opacity: 0;
  }
}

.toast-notification.hiding {
  animation: slideOutRight 0.35s ease forwards;
}

/* Booking List */
.booking-list-item {
  transition: all 0.25s ease;
  font-size: 1.05rem;
}

.booking-list-item:hover {
  background-color: #f9fafb;
  transform: translateX(6px);
}

/* Mobile responsive adjustments for queue list */
@media (max-width: 640px) {
  .booking-list-item {
    font-size: 0.95rem;
  }
  
  .booking-list-item:hover {
    transform: translateX(0);
  }
  
  /* Ensure buttons are full width on mobile */
  #staff-queue-list .call-queue-btn,
  #staff-queue-list .skip-queue-btn,
  #staff-queue-list .recall-queue-btn {
    min-width: 0;
  }
}

/* Buttons */
.cancel-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.45);
}

.cancel-btn.confirming {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* =====================================================
   My Bookings Card UI - Clean Modern Design
   ===================================================== */
.booking-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.booking-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.queue-badge {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.booking-header-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.license-plate {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.booking-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #4b5563;
}

.detail-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.detail-label {
  color: #6b7280;
  flex-shrink: 0;
}

.detail-value {
  font-weight: 600;
  color: #1f2937;
}

/* Cancel Button */
.cancel-booking-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.cancel-booking-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.cancel-booking-btn.confirming {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  animation: pulse 1s ease-in-out infinite;
}

/* Coil Form Section */
.coil-form-section {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #a7f3d0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.coil-form-section.wrong-coil {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}

.coil-form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #047857;
  margin-bottom: 12px;
}

.coil-form-section.wrong-coil .coil-form-header {
  color: #b91c1c;
}

.coil-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coil-input-row {
  display: flex;
  gap: 8px;
}

.coil-input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.coil-input:focus {
  border-color: #10b981;
}

.coil-form-section.wrong-coil .coil-input:focus {
  border-color: #f87171;
}

/* ปุ่มเพิ่ม/ลบคอยล์ - ให้มองเห็นชัดและกดง่าย */
.add-coil-btn,
.remove-coil-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  font-weight: 700;
}

.add-coil-btn {
  background: #059669;
  color: #fff;
  border-color: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

.add-coil-btn:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
}

.remove-coil-btn {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.remove-coil-btn:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
}

.coil-btn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.coil-btn-label {
  font-size: 0.7rem;
  line-height: 1;
  white-space: nowrap;
}

/* ปุ่มเพิ่ม/ลบคอยล์บนมือถือ - ใหญ่และมองเห็นชัด */
@media (max-width: 768px) {
  .add-coil-btn,
  .remove-coil-btn {
    min-width: 72px;
    min-height: 56px;
    padding: 12px 14px;
    gap: 4px;
  }
  .add-coil-btn .coil-btn-icon,
  .remove-coil-btn .coil-btn-icon {
    font-size: 1.75rem;
  }
  .add-coil-btn .coil-btn-label,
  .remove-coil-btn .coil-btn-label {
    font-size: 0.8rem;
  }
}

.submit-coils-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.submit-coils-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Coil Waiting Notice */
.coil-waiting-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* QR Section - การ์ดและกล่อง QR เป็นพื้นขาว ข้อความสีเข้ม อ่านง่าย */
.qr-section {
  /* ใช้ภาพพื้นหลังสีขาวเพื่อกัน forced dark mode เปลี่ยนสี */
  background-color: #ffffff !important;
  background-image: var(--qr-white-bg) !important;
  background-size: 100% 100%;
  background-repeat: repeat;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: none;
  box-shadow: none;
  outline: none;
  color-scheme: light;
}

.qr-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #6d28d9;
  margin-bottom: 12px;
}

.qr-header svg {
  color: #6d28d9;
}

/* บล็อกสี่เหลี่ยมขาวใหญ่กว่า QR เล็กน้อย — ใช้ <img> จริงเป็นพื้นกัน forced dark mode */
.qr-code-box {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  padding: 20px;
  min-width: 200px;
  min-height: 200px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  border: none;
  box-shadow: none;
  outline: none;
}

/* ภาพขาวจริง (content image) — เบราว์เซอร์ไม่ invert content image ใน dark mode */
.qr-white-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  z-index: 0;
  pointer-events: none;
  object-fit: fill;
}

.qr-code-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code-box canvas,
.qr-code-box img:not(.qr-white-frame) {
  border-radius: 8px;
  border: none;
  box-shadow: none;
  outline: none;
}

.qr-hint {
  font-size: 0.8rem;
  color: #7c3aed;
  margin-bottom: 12px;
}

.qr-info {
  /* ใช้ภาพพื้นหลังเทาอ่อนเพื่อกัน forced dark mode เปลี่ยนสี */
  background-color: #f3f4f6 !important;
  background-image: var(--qr-gray-bg) !important;
  background-size: 100% 100%;
  background-repeat: repeat;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
}

.qr-info-row {
  display: flex;
  gap: 6px;
  font-size: 0.85rem;
  color: #1f2937;
  padding: 4px 0;
}

.qr-info-label {
  font-weight: 600;
  color: #6b7280;
  min-width: 60px;
}

@media (prefers-color-scheme: dark) {
  .qr-section {
    background-color: #ffffff !important;
    background-image: var(--qr-white-bg) !important;
    border: none;
    box-shadow: none;
    outline: none;
    color-scheme: light;
  }
  .qr-code-box canvas,
  .qr-code-box img:not(.qr-white-frame) {
    /* canvas/img ไม่ต้องมี background — qr-white-frame ทำหน้าที่แทน */
    background: transparent;
  }
  .qr-info {
    background-color: #f3f4f6 !important;
    background-image: var(--qr-gray-bg) !important;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .booking-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .booking-header-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .queue-badge {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  
  .license-plate {
    font-size: 1.1rem;
  }
}

.save-info-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  transition: all 0.3s ease;
  font-size: 1.05rem;
}

.save-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45);
}

.save-info-btn.saved {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.call-queue-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transition: all 0.3s ease;
}

.call-queue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

.call-queue-btn.confirming {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  animation: pulse 1.1s ease-in-out infinite;
}

.skip-queue-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transition: all 0.3s ease;
}

.skip-queue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.45);
}

.skip-queue-btn.confirming {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 1.1s ease-in-out infinite;
}

.recall-queue-btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  transition: all 0.3s ease;
}

.recall-queue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(var(--color-secondary-rgb), 0.45);
}

/* Summary Screen */
.summary-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(12px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.summary-screen.show {
  display: flex;
  animation: fadeIn 0.35s ease forwards;
}

.summary-card {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border-radius: 2rem;
  max-width: 650px;
  width: 100%;
  padding: 3rem;
  position: relative;
  animation: bounceIn 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 
    0 35px 70px rgba(0, 0, 0, 0.65),
    0 0 0 3px rgba(var(--color-primary-rgb), 0.25),
    inset 0 3px 5px rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  border: 4px solid rgba(var(--color-primary-rgb), 0.25);
  backdrop-filter: blur(12px);
  padding-bottom: 4.5rem; /* เผื่อพื้นที่ให้ปุ่มลอยด้านล่าง */
}

.summary-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.06) 0%, transparent 70%);
  animation: rotate 22s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Confetti */
.confetti-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 10;
}

.confetti {
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0;
  animation: confetti-fall 2.2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(320px) rotate(720deg);
  }
}

/* Queue Number Display */
.queue-number-display {
  font-size: 8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 0 35px rgba(var(--color-primary-rgb), 0.45));
  position: relative;
  animation: glow 2.2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 25px rgba(var(--color-primary-rgb), 0.35));
  }
  50% {
    filter: drop-shadow(0 0 45px rgba(var(--color-primary-rgb), 0.65));
  }
}

/* Checkmark Animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark 0.7s ease-in-out 0.25s forwards;
}

.checkmark-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark 0.35s ease-in-out 0.7s forwards;
}

/* Info Row */
.info-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 1.4rem;
  border-left: 4px solid var(--color-primary);
  font-size: 1rem;
}

/* License Plate */
.license-plate {
  background: white;
  border: 3px solid #1a1a1a;
  border-radius: 0.6rem;
  padding: 1.2rem 1.8rem;
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.22);
  position: relative;
}

.license-plate-header {
  text-align: center;
  font-size: 0.7em;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.6px;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.license-plate-input {
  text-align: center;
  font-weight: 800;
  font-size: 2.8em;
  letter-spacing: 5px;
  color: #1a1a1a;
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  text-transform: uppercase;
}

.license-plate-input::placeholder {
  color: #999;
  font-weight: 600;
}

/* Phone Input */
.phone-input-wrapper {
  position: relative;
}

.phone-helper-text {
  font-size: 0.95em;
  color: #6b7280;
  margin-top: 0.6rem;
}

.phone-error {
  color: #ef4444;
  font-size: 0.95em;
  margin-top: 0.3rem;
  display: none;
}

.phone-error.show {
  display: block;
}

/* Dashboard */
.status-dashboard {
  display: grid;
  gap: 1.8rem;
}

.dashboard-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 1.8rem;
  padding: 2.2rem;
  box-shadow: 
    0 5px 18px rgba(0, 0, 0, 0.09),
    0 0 0 1px rgba(var(--color-primary-rgb), 0.06);
  transition: all 0.35s ease;
  border: 1px solid rgba(var(--color-primary-rgb), 0.12);
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.dashboard-card:hover::before {
  opacity: 1;
}

.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.current-queue-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
}

.waiting-queue-card {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  padding: 1.2rem;
  border-radius: 1.2rem;
  text-align: center;
}

.stat-card {
  transition: all 0.35s ease;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

/* Close Button */
.close-summary-btn {
  /* Add styling if needed */
}

/* Floating "Done" button base style */
#close-summary-btn-2 {
  border-radius: 9999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* Responsive */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  
  body > * {
    max-width: 100vw !important;
  }
  
  #evening-slots,
  #morning-slots {
    grid-template-columns: 1fr !important;
  }
  
  .time-slot-btn {
    padding: 1.5rem 1rem !important;
  }
  
  .form-container {
    padding: 1.5rem !important;
    max-width: 100% !important;
  }
  
  input, textarea, select, button {
    font-size: 18px !important;
  }
  
  label {
    font-size: 1.1rem !important;
  }
  
  .queue-number-display {
    font-size: clamp(2.5rem, 12vw, 4rem) !important;
  }
  
  .summary-screen {
    padding: 0.75rem !important;
    align-items: flex-start !important;
    padding-top: 1rem !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .summary-card {
    padding: 1rem !important;
    border-radius: 1.5rem !important;
    margin-top: 0 !important;
    max-height: calc(100vh - 2rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: calc(100vw - 1.5rem) !important;
    width: 100% !important;
    padding-bottom: 4.5rem !important; /* เผื่อพื้นที่ให้ปุ่มลอยด้านล่าง */
  }

  .info-row {
    padding: 0.85rem !important;
    gap: 0.75rem !important;
  }

  .info-row svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }

  .confetti-container {
    width: 160px !important;
    height: 160px !important;
  }

  #close-summary-btn-2 {
    padding-top: 0.9rem !important;
    padding-bottom: 0.9rem !important;
    font-size: 1rem !important;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-radius: 9999px !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    margin-top: 1rem;
    margin-bottom: 0;
  }
  
  .summary-card > * {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
  }
  
  .summary-card .text-4xl {
    font-size: 1.75rem !important;
  }
  
  .summary-card .text-3xl {
    font-size: 1.5rem !important;
  }
  
  .summary-card .text-2xl {
    font-size: 1.25rem !important;
  }
  
  .summary-card .text-xl {
    font-size: 1.125rem !important;
  }
  
  .summary-card .text-lg {
    font-size: 1rem !important;
  }
  
  .close-summary-btn {
    width: 2.5rem !important;
    height: 2.5rem !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
  }
  
  .close-summary-btn svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }
}

/* View Transition API */
@view-transition {
  navigation: auto;
}
