/* ==========================================================================
   DESIGN SYSTEM & CUSTOM VARIABLES (L'Héritage d'Antoine)
   ========================================================================== */

:root {
  /* Color Palette */
  --color-brand: #631227;       /* Deep Bordeaux */
  --color-brand-light: #801d36; /* Rose Bordeaux */
  --color-accent: #dfb284;      /* Satin Gold */
  --color-accent-dark: #b88d5c; /* Bronze Gold */
  --color-bg-base: #faf6f6;     /* Cream Base */
  --color-bg-card: rgba(255, 255, 255, 0.85); /* Glassmorphism backdrop */
  --color-text-main: #2b1f21;   /* Espresso Brown */
  --color-text-muted: #7c6266;  /* Cocoa Brown */
  --color-border: rgba(223, 178, 132, 0.35); /* Soft Gold Borders */
  
  /* Status Colors */
  --color-success: #48bb78;     /* Pistachio Green */
  --color-success-bg: #e6fffa;
  --color-warning: #ecc94b;     /* Lemon Yellow */
  --color-warning-bg: #fffaf0;
  --color-danger: #e53e3e;      /* Raspberry Red */
  --color-danger-bg: #fff5f5;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-sans: 'Outfit', sans-serif;

  /* Shadows & Radius */
  --shadow-soft: 0 10px 30px rgba(99, 18, 39, 0.05);
  --shadow-hover: 0 15px 35px rgba(99, 18, 39, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-brand);
}

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

/* ==========================================================================
   LAYOUT: SIDEBAR
   ========================================================================== */

.sidebar {
  width: 290px;
  background-color: #ffffff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 35px 25px;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.brand-section {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 25px;
  border-bottom: 1px dashed var(--color-border);
}

.brand-title {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  margin-top: 5px;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--color-text-main);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item button:hover {
  background-color: var(--color-bg-base);
  color: var(--color-brand);
  transform: translateX(4px);
}

.nav-item.active button {
  background-color: var(--color-brand);
  color: #ffffff;
  border-color: var(--color-brand);
  box-shadow: 0 8px 20px rgba(99, 18, 39, 0.15);
}

/* Chef Profile Card */
.chef-card {
  background-color: var(--color-bg-base);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.chef-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-brand), var(--color-accent));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.chef-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.chef-info p {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ==========================================================================
   LAYOUT: MAIN CONTENT
   ========================================================================== */

.main-content {
  margin-left: 290px;
  flex-grow: 1;
  padding: 40px 50px;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 25px;
}

.header-title h1 {
  font-size: 34px;
  margin-bottom: 4px;
}

.header-title p {
  color: var(--color-text-muted);
  font-size: 15px;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-success);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(72, 187, 120, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
  }
}

/* ==========================================================================
   GLASS CARDS & VIEWS
   ========================================================================== */

.app-view {
  display: none;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-view.active {
  display: block;
}

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

.glass-card {
  background: var(--color-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 30px;
  margin-bottom: 30px;
}

/* ==========================================================================
   VIEW 1: KITCHEN OPERATIONS DASHBOARD
   ========================================================================== */

/* KPI Summary Widgets */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-widget {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-widget:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.kpi-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-brand);
}

.kpi-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background-color: var(--color-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* Live Analytics Grid */
.dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

/* Oven Telemetry Widget */
.oven-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 15px;
}

.oven-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oven-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.oven-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: bold;
}

.oven-status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.oven-status.preheating {
  background-color: var(--color-warning-bg);
  color: #b7791f;
}

.oven-status.baking {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.oven-status.idle {
  background-color: var(--color-bg-base);
  color: var(--color-text-muted);
}

.temp-indicator {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.temp-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-brand-light);
}

.temp-target {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Thermometer Slider Graphic */
.oven-thermometer {
  height: 8px;
  width: 100%;
  background-color: var(--color-bg-base);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.thermometer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-brand));
  border-radius: 4px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Order Board Queue */
.order-queue {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.order-ticket {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  animation: ticketSlideIn 0.4s ease forwards;
}

@keyframes ticketSlideIn {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ticket-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ticket-id {
  font-weight: bold;
  font-size: 15px;
  color: var(--color-brand);
}

.ticket-items {
  font-size: 14px;
  color: var(--color-text-muted);
}

.ticket-time {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.ticket-state-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.badge-state {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-state.queued {
  background-color: var(--color-warning-bg);
  color: #b7791f;
}

.badge-state.baking {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge-state.ready {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.btn-complete-order {
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  background-color: var(--color-brand);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-complete-order:hover {
  background-color: var(--color-brand-light);
}

/* ==========================================================================
   VIEW 2: CATERING PLANNER & ESTIMATOR
   ========================================================================== */

.catering-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.form-group-gourmet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group-gourmet label {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-select-gourmet,
.form-input-gourmet {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.3s;
}

.form-select-gourmet:focus,
.form-input-gourmet:focus {
  border-color: var(--color-brand);
}

/* Catering Quote Summary Display */
.quote-display-card {
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-light));
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 20px;
  box-shadow: 0 15px 35px rgba(99, 18, 39, 0.25);
  position: relative;
  overflow: hidden;
}

.quote-decor {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(223, 178, 132, 0.08);
  top: -80px;
  right: -80px;
  pointer-events: none;
}

.quote-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-accent);
  text-transform: uppercase;
}

.quote-price {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.quote-breakdown {
  width: 100%;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.85);
}

.quote-row.total {
  font-weight: bold;
  font-size: 16px;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}

.btn-book-catering {
  width: 100%;
  padding: 14px;
  border-radius: 50px;
  border: none;
  background-color: var(--color-accent);
  color: var(--color-brand);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.btn-book-catering:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   VIEW 3: RECIPE SCALER
   ========================================================================== */

.scaler-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.recipe-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.recipe-card-btn {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.recipe-card-btn:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.recipe-card-btn.active {
  background-color: var(--color-brand-light);
  color: #ffffff;
  border-color: var(--color-brand-light);
  box-shadow: var(--shadow-hover);
}

.recipe-card-btn.active .recipe-icon {
  background-color: rgba(255, 255, 255, 0.15);
}

.recipe-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
}

.recipe-card-btn h4 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: inherit;
}

/* Ingredients Scaling List */
.ingredients-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.ingredients-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--color-bg-base);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.scaled-yield-badge {
  background-color: var(--color-bg-base);
  color: var(--color-brand);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-bg-base);
}

.ingredient-name {
  font-size: 15px;
  font-weight: 500;
}

.ingredient-amount {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-brand-light);
}

/* ==========================================================================
   SHARED ELEMENTS: FEATURE IMAGES
   ========================================================================== */

.feature-img-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.feature-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(43, 31, 33, 0.95));
  padding: 30px;
  color: #ffffff;
}

.feature-img-caption h3 {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 5px;
}

.feature-img-caption p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .catering-split,
  .scaler-layout {
    grid-template-columns: 1fr;
  }
  .feature-img-wrapper {
    height: 300px;
  }
}

@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 25px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .brand-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
  }
  .nav-item button {
    padding: 10px 14px;
    font-size: 14px;
  }
  .chef-card {
    display: none; /* Hide profile card on mobile view to save space */
  }
  .main-content {
    margin-left: 0;
    padding: 25px;
  }
}
