/* ==========================================================================
   CWC INTERACTIVE RECIPE APP - DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #090D16;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 52, 0.9);
  --bg-card-subtle: rgba(255, 255, 255, 0.03);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.4);
  
  --primary: #F59E0B; /* Saffron Gold */
  --primary-hover: #D97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  
  --accent-blue: #3B82F6;
  --accent-emerald: #10B981;
  --accent-rose: #F43F5E;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 90px; /* Space for sticky buttons */
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* App Header */
.app-header {
  padding: 16px 16px 8px 16px;
  max-width: 600px;
  margin: 0 auto;
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--primary);
}

/* Hero Card */
.hero-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-tag {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 16px;
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.meta-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-icon {
  font-size: 1.2rem;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.meta-pill strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* 3-Phase Navigation Bar */
.phase-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.phase-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.phase-btn .phase-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.phase-text small {
  display: block;
  font-size: 0.65rem;
  opacity: 0.8;
}

.phase-btn.active {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.phase-btn.active .phase-num {
  background: #000;
  color: var(--primary);
}

/* Main Container & Sections */
.app-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.phase-section {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.phase-section.active {
  display: block;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Portion Scaler */
.scale-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.scale-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scale-btn .scale-name {
  font-size: 0.75rem;
  font-weight: 600;
}

.scale-btn .scale-qty {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.scale-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.scale-btn.active .scale-qty {
  color: var(--primary);
}

/* Ingredient Group Cards */
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.group-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.badge-gold { background: rgba(245, 158, 11, 0.15); color: var(--primary); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge-red { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

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

.ing-list {
  list-style: none;
}

.ing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ing-item:last-child {
  border-bottom: none;
}

.ing-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  flex: 1;
}

.ing-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

.ing-item.checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.ing-qty {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

/* Tool Grid */
.tool-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}

.tool-item input {
  accent-color: var(--accent-emerald);
}

/* Cooking Mode (Fasa 2) */
.cooking-progress-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Step Cards */
.steps-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: border-color 0.2s ease;
}

.step-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

.step-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.step-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Pro Tips & Diagrams */
.pro-tip-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.spiral-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  margin-bottom: 14px;
  font-size: 0.75rem;
  text-align: center;
}

.diag-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.diag-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diag-arrow {
  color: var(--text-muted);
  font-weight: bold;
}

/* Interactive Timers */
.timer-widget {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timer-meta {
  display: flex;
  flex-direction: column;
}

.timer-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.timer-display {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.timer-controls {
  display: flex;
  gap: 6px;
}

.timer-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-start {
  background: var(--primary);
  color: #000;
}

.btn-start.running {
  background: var(--accent-rose);
  color: #fff;
}

.btn-reset {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.step-complete-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 8px;
}

.step-complete-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-emerald);
}

/* Fasa 3: Selepas (Cost Calculator) */
.calc-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.input-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.calc-res-item {
  display: flex;
  flex-direction: column;
}

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

.res-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.highlight-green { color: var(--accent-emerald); }
.highlight-gold { color: var(--primary); }

/* Storage Tabs */
.storage-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.storage-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.storage-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.storage-item h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.storage-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.temp-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

/* Accordion */
.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.acc-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.acc-trigger {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.acc-icon {
  font-size: 1.2rem;
  color: var(--primary);
}

.acc-body {
  display: none;
  padding: 0 14px 14px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.acc-item.open .acc-body {
  display: block;
}

.acc-item.open .acc-icon {
  transform: rotate(45deg);
}

/* Help / Community */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #000;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 12px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Sticky Footer Navigation */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(9, 13, 22, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  z-index: 100;
}

.btn-primary {
  width: 100%;
  max-width: 568px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Paywall & Access Badges */
.access-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.access-badge.locked {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.access-badge.unlocked {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* Paywall Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--primary-glow);
}

.modal-lock-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.passcode-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 16px;
}

.passcode-box label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.passcode-input-row {
  display: flex;
  gap: 8px;
}

.passcode-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.passcode-input-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-unlock {
  background: linear-gradient(135deg, var(--primary), #D97706);
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  cursor: pointer;
  white-space: nowrap;
}

.passcode-error {
  font-size: 0.78rem;
  color: #EF4444;
  margin-top: 6px;
  min-height: 16px;
}

.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-divider span {
  padding: 0 10px;
}

.modal-buy-box {
  margin-bottom: 20px;
}

.modal-buy-box p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-buy-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-close-modal {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
