/* Premium CSS Design System for QR Multi-Tenant Platform */

:root {
  /* Default Theme (Sunset) */
  --primary-color: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #ffedd5;
  --success-color: #10b981;
  --success-hover: #059669;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --warning-color: #eab308;
  --info-color: #3b82f6;
  
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --font-family: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* Theme Variations */
.theme-forest {
  --primary-color: #10b981;
  --primary-hover: #059669;
  --primary-light: #d1fae5;
}

.theme-ocean {
  --primary-color: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-light: #e0f2fe;
}

.theme-violet {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #ede9fe;
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .logo-text, .hotel-title {
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
}

.w-full { width: 100%; }
.w-half { width: 50%; }
.w-third { width: 33.33%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.block { display: block; }
.hidden { display: none !important; }
.animate-spin {
  animation: spin 1s linear infinite;
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Core Components: Cards, Buttons, Inputs */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  transition: background-color 0.2s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-secondary {
  background-color: #f1f5f9;
  border-color: var(--border-color);
  color: #334155;
}
.btn-secondary:hover {
  background-color: #e2e8f0;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
.btn-icon-only {
  padding: 0.5rem;
  border-radius: 50%;
  aspect-ratio: 1;
}

.input, .textarea, .select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, .textarea:focus {
  border-color: var(--primary-color);
}
.textarea {
  min-height: 80px;
  resize: vertical;
}
.label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #334155;
}
.form-group {
  margin-bottom: 1.25rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* --- Welcome / Landing Page --- */
.welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.welcome-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.logo-icon {
  width: 64px;
  height: 64px;
}
.logo-text {
  font-size: 2.25rem;
  color: var(--text-color);
}
.welcome-desc {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 2rem;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

/* --- Global Admin Layout --- */
.global-admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}
.global-sidebar {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.global-main {
  padding: 2rem;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.hotels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.hotel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}
.hotel-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.hotel-icon {
  width: 32px;
  height: 32px;
}
.hotel-name-text {
  font-size: 1.15rem;
}
.hotel-slug-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hotel-meta {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.hotel-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Customer UI --- */
.customer-app {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.customer-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-badge {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}
.menu-cart-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
}
.menu-controls {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.controls-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.filter-btn.active {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.categories-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.items-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.menu-item-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.item-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.item-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.item-name {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.veg-badge {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  padding: 1px;
  background-clip: content-box;
}
.veg-badge.veg {
  border-color: #10b981;
  background-color: #10b981;
}
.veg-badge.nonveg {
  border-color: #ef4444;
  background-color: #ef4444;
}
.price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.price-actual {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
}
.price-original {
  font-size: 0.85rem;
  text-decoration: line-through;
  color: var(--text-muted);
}
.item-desc {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  flex: 1;
}
.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.item-category-tag {
  background-color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* --- Cart & Checkout UI --- */
.cart-pane {
  position: sticky;
  top: 1.5rem;
  height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
}
.cart-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}
.cart-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  overflow-y: auto;
}
.cart-items-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dotted var(--border-color);
  padding-bottom: 0.75rem;
}
.cart-item-info {
  display: flex;
  flex-direction: column;
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qty-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  font-size: 0.85rem;
}
.cart-summary {
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.promo-highlight {
  color: var(--success-color);
  font-weight: 600;
}
.total-row {
  font-weight: 700;
  font-size: 1.1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}
.payment-method-selector {
  margin-top: 1.25rem;
}
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pay-option {
  padding: 0.75rem;
  cursor: pointer;
}
.pay-option.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}
.pay-option input {
  display: none;
}
.pay-option-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

/* --- Modals & Overlays --- */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  z-index: 101;
  max-width: 480px;
  width: 90%;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalEnter {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.border-highlight {
  border-top: 4px solid var(--primary-color);
}

/* --- Timer Countdown --- */
.timer-area {
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}
.clock-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#timer-clock {
  font-size: 3rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--primary-color);
  letter-spacing: 2px;
}
.timer-ready {
  color: var(--success-color) !important;
  font-size: 2rem !important;
  font-family: var(--font-heading) !important;
}

/* Star Rating System */
.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 2.25rem;
}
.star-btn {
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.1s;
}
.star-btn.selected {
  color: #fbbf24;
}

/* Drawer Component (History) */
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  z-index: 90;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-right: none;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.history-item {
  padding: 1rem;
}
.history-item-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* --- Admin Layout --- */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  color: #475569;
  text-align: left;
  font-size: 0.95rem;
  transition: background-color 0.2s, color 0.2s;
}
.nav-link:hover, .nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.admin-main {
  padding: 2rem;
  overflow-y: auto;
  height: 100vh;
}

/* Admin Orders Board Columns */
.orders-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  height: calc(100vh - 8rem);
}
.board-column {
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.column-title {
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid #cbd5e1;
}
.border-pending { border-color: #94a3b8; }
.border-preparing { border-color: var(--primary-color); }
.border-served { border-color: var(--success-color); }

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
}
.order-card {
  padding: 1rem;
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}
.order-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.order-card-items {
  border-top: 1px dotted var(--border-color);
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.order-card-item {
  display: flex;
  justify-content: space-between;
}
.order-card-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.payment-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.payment-badge.pending { background-color: #fee2e2; color: #991b1b; }
.payment-badge.paid { background-color: #d1fae5; color: #065f46; }

.order-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Status Indicator tags */
.status-indicator-tag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}
.status-pending { background-color: #e2e8f0; color: #475569; }
.status-preparing { background-color: var(--primary-light); color: var(--primary-color); }
.status-served { background-color: #d1fae5; color: #065f46; }

/* Table styles (Menu admin) */
.table-container {
  overflow-x: auto;
  padding: 0;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th, .table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.menu-table-dish {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dish-table-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge.success { background-color: #d1fae5; color: #065f46; }
.badge.danger { background-color: #fee2e2; color: #991b1b; }
.table-actions {
  display: flex;
  gap: 0.5rem;
}

/* Settings and Analytics layouts */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 40px;
  height: 40px;
}
.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Responsive Overrides */
@media (max-width: 960px) {
  .global-admin-layout {
    grid-template-columns: 1fr;
  }
  .global-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .menu-cart-container {
    grid-template-columns: 1fr;
  }
  .cart-pane {
    position: static;
    height: auto;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .orders-board {
    grid-template-columns: 1fr;
    height: auto;
  }
}
