/* ==========================================================================
   Company Restaurant Menu Kiosk - Modern Premium Design System
   ========================================================================== */

:root {
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Color System - Dark Theme (Default) */
  --bg-base: #0B0E14;
  --bg-surface: #131822;
  --bg-surface-elevated: #1B2232;
  --bg-pill: #242D40;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 204, 0, 0.4);
  
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --accent-gold: #F59E0B;
  --accent-emerald: #10B981;
  --accent-blue: #3B82F6;
  --accent-danger: #EF4444;

  --card-radius: 20px;
  --pill-radius: 100px;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-pill: #E2E8F0;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-active: rgba(245, 158, 11, 0.6);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* App Container */
.kiosk-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Component */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-gold), #D97706);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.restaurant-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.restaurant-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Live Clock Component */
.clock-card {
  background: var(--bg-surface-elevated);
  padding: 8px 20px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-color);
  text-align: center;
}

.clock-time {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.clock-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mode Selector Pill */
.mode-selector-pill {
  display: flex;
  background: var(--bg-pill);
  padding: 4px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--pill-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mode-btn#btnModeFocused.active {
  color: var(--accent-emerald);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--pill-radius);
  color: var(--accent-emerald);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
}

.icon-btn:hover {
  background: var(--bg-pill);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn.active {
  background: var(--accent-gold);
  color: #000;
}

/* Main Content Layout */
.main-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

/* Days Navigation Bar */
.days-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.day-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.day-tab:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

.day-tab.active {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-gold);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.tab-day-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.tab-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.today-badge {
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border-radius: 10px;
}

/* Hero Showcase Section */
.hero-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.hero-showcase:hover {
  transform: translateY(-2px);
}

.hero-image-wrapper {
  position: relative;
  min-height: 380px;
  background: var(--bg-pill);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-badge-group {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.hero-badge {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--pill-radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-ai-regen-btn {
  background: rgba(245, 158, 11, 0.85);
  color: #000;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-ai-regen-btn:hover {
  background: var(--accent-gold);
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.1), rgba(19, 24, 34, 0.8));
}

.hero-details {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.hero-category-tag.veggie {
  color: var(--accent-emerald);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.meta-tag {
  font-size: 0.9rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
}

.last-scraped-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Courses Section */
.courses-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  transition: all 0.25s var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: var(--border-active);
}

.course-card.is-balanced-veggie {
  border-left: 4px solid var(--accent-emerald);
}

.course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.course-category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: var(--bg-pill);
  border-radius: var(--pill-radius);
  color: var(--text-secondary);
}

.course-category-badge.veggie-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.card-ai-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-ai-btn:hover {
  background: var(--bg-pill);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.course-dish-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
}

.course-details-list {
  list-style-type: disc;
  padding-left: 18px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.course-details-list li {
  margin-bottom: 4px;
}

/* Native 1:1 Square Ratio matching Gemini AI generated photos */
.course-image-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  margin-top: auto;
  display: block;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-state i {
  margin-bottom: 16px;
  color: var(--accent-gold);
}

/* Footer Component */
.footer {
  padding: 16px 32px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-footer-tag {
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 90%;
  max-width: 540px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Interactive Dish Detail Popup Modal - 1:1 Aspect Ratio Banner */
.dish-detail-card {
  max-width: 580px !important;
  padding: 0 !important;
  overflow: hidden;
  position: relative;
}

.dish-detail-card .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #FFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dish-detail-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  background: var(--bg-pill);
}

.dish-detail-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dish-detail-body {
  padding: 28px;
}

.dish-detail-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;

  h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
  }
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 18px;

  label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
  }
}

.select-input, .input-with-icon input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.input-with-icon {
  position: relative;

  i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
  }

  input {
    padding-left: 36px;
  }
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  &.btn-primary {
    background: var(--accent-gold);
    color: #000;
  }

  &.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }
}

.status-box {
  margin-top: 16px;
  padding: 10px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Pure 16:9 Kiosk / Signage Mode (URL: /kiosk or ?kiosk=true) */
body.pure-kiosk-mode {
  overflow: hidden !important;
}

body.pure-kiosk-mode .header {
  padding: 16px 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

body.pure-kiosk-mode .mode-selector-pill,
body.pure-kiosk-mode #statusBadge,
body.pure-kiosk-mode #themeToggle,
body.pure-kiosk-mode #carouselToggle,
body.pure-kiosk-mode #refreshBtn,
body.pure-kiosk-mode #adminBtn,
body.pure-kiosk-mode .days-nav,
body.pure-kiosk-mode .hero-showcase,
body.pure-kiosk-mode .section-header,
body.pure-kiosk-mode .footer-left {
  display: none !important;
}

body.pure-kiosk-mode .kiosk-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.pure-kiosk-mode .main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 40px;
  overflow: hidden;
  max-width: 100%;
}

body.pure-kiosk-mode .courses-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Centered Flexbox Layout for 1, 2, or 3 cards */
body.pure-kiosk-mode .courses-grid {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 36px;
  height: 100%;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

body.pure-kiosk-mode .course-card {
  flex: 1;
  max-width: 540px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 24px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-color);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  padding: 24px;
  overflow: hidden;
  position: relative;
  cursor: default !important;
}

body.pure-kiosk-mode .course-header {
  position: relative;
  top: auto;
  left: auto;
  margin-bottom: 18px;
}

body.pure-kiosk-mode .course-category-badge {
  font-size: 1.05rem;
  padding: 8px 20px;
  border-radius: var(--pill-radius);
  background: var(--bg-pill);
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
}

body.pure-kiosk-mode .course-category-badge.veggie-badge {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

body.pure-kiosk-mode .card-ai-btn {
  display: none !important;
}

/* Image framing - Native 1:1 Aspect Ratio centered */
body.pure-kiosk-mode .course-image-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  margin-bottom: 20px;
  flex-shrink: 0;
}

body.pure-kiosk-mode .course-dish-title {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text-primary);
}

body.pure-kiosk-mode .course-details-list {
  padding-left: 24px;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
