@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-gradient: radial-gradient(circle at 50% 10%, #1a1e36 0%, #0c0f1a 100%);
  --card-bg: rgba(23, 29, 54, 0.65);
  --card-bg-hover: rgba(30, 38, 70, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-active: rgba(99, 102, 241, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --steak-color: #f43f5e;
  --steak-gradient: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  --steak-glow: rgba(244, 63, 94, 0.25);
  --steak-bg-light: rgba(244, 63, 94, 0.1);
  
  --pork-color: #10b981;
  --pork-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --pork-glow: rgba(16, 185, 129, 0.25);
  --pork-bg-light: rgba(16, 185, 129, 0.1);
  
  --fish-color: #0ea5e9;
  --fish-gradient: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  --fish-glow: rgba(14, 165, 233, 0.25);
  --fish-bg-light: rgba(14, 165, 233, 0.1);
  
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

/* Base Container & Glassmorphism */
.app-container {
  width: 100%;
  max-width: 520px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.6s ease-out;
  position: relative;
}

.dashboard-container {
  max-width: 900px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.45); }
}

/* Typography */
h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 35px;
}

/* Forms & Selection */
.form-group {
  margin-bottom: 25px;
}

.label-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Meal options custom radio cards */
.meal-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.meal-option {
  position: relative;
  cursor: pointer;
}

.meal-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.meal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 10px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.meal-card:hover {
  background: var(--card-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.meal-icon {
  font-size: 2rem;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  transition: var(--transition);
}

.meal-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

/* Radio Checked States */
.meal-option input[type="radio"]:checked + .meal-card {
  background: var(--card-bg-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px -5px rgba(0,0,0,0.5);
}

/* Steak Specific Checked */
.meal-option.steak input[type="radio"]:checked + .meal-card {
  border-color: var(--steak-color);
  box-shadow: 0 8px 25px -5px var(--steak-glow);
}
.meal-option.steak input[type="radio"]:checked + .meal-card .meal-icon {
  background: var(--steak-gradient);
  transform: scale(1.1);
}
.meal-option.steak input[type="radio"]:checked + .meal-card .meal-name {
  color: var(--steak-color);
}

/* Pork Specific Checked */
.meal-option.pork input[type="radio"]:checked + .meal-card {
  border-color: var(--pork-color);
  box-shadow: 0 8px 25px -5px var(--pork-glow);
}
.meal-option.pork input[type="radio"]:checked + .meal-card .meal-icon {
  background: var(--pork-gradient);
  transform: scale(1.1);
}
.meal-option.pork input[type="radio"]:checked + .meal-card .meal-name {
  color: var(--pork-color);
}

/* Fish Specific Checked */
.meal-option.fish input[type="radio"]:checked + .meal-card {
  border-color: var(--fish-color);
  box-shadow: 0 8px 25px -5px var(--fish-glow);
}
.meal-option.fish input[type="radio"]:checked + .meal-card .meal-icon {
  background: var(--fish-gradient);
  transform: scale(1.1);
}
.meal-option.fish input[type="radio"]:checked + .meal-card .meal-name {
  color: var(--fish-color);
}

/* Name Input field */
.input-wrapper {
  position: relative;
  width: 100%;
}

.text-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  background: rgba(0, 0, 0, 0.35);
}

.text-input::placeholder {
  color: var(--text-muted);
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loader Animation inside Button */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Message Feedback */
.feedback-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.feedback-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback-error {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* SUCCESS CARD VIEW (Form success transition) */
.success-card {
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.success-icon {
  font-size: 3.5rem;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--pork-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.success-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.success-body {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   DASHBOARD / WAR ROOM STYLING
   ========================================================================== */

/* War Room Header Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--steak-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--steak-color);
  border-radius: 50%;
  animation: pulse-glow 1.5s infinite;
}

/* Stats Summary Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 35px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card.steak-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--steak-gradient);
}
.stat-card.pork-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--pork-gradient);
}
.stat-card.fish-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--fish-gradient);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 12px;
  transition: var(--transition);
}

.stat-card.steak-card .stat-value { color: var(--steak-color); }
.stat-card.pork-card .stat-value { color: var(--pork-color); }
.stat-card.fish-card .stat-value { color: var(--fish-color); }

/* Progress Mini Bars */
.stat-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.stat-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.steak-card .stat-progress-fill { background: var(--steak-gradient); }
.stat-card.pork-card .stat-progress-fill { background: var(--pork-gradient); }
.stat-card.fish-card .stat-progress-fill { background: var(--fish-gradient); }

/* Detailed Responses Log Section */
.log-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 25px;
}

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

.log-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.reset-button {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.15);
  color: var(--steak-color);
  padding: 8px 16px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.reset-button:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Order Log Table */
.order-table-container {
  max-height: 300px;
  overflow-y: auto;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
}

.order-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}

.order-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
}

.order-table tr {
  transition: var(--transition);
}

.order-table tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.order-table tr.new-row {
  animation: highlightRow 1.2s ease-out;
}

@keyframes highlightRow {
  0% { background: rgba(99, 102, 241, 0.25); transform: translateY(-10px); opacity: 0; }
  20% { opacity: 1; }
  100% { background: transparent; transform: translateY(0); }
}

/* Badges for Meal tags */
.meal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.meal-badge-steak {
  background: var(--steak-bg-light);
  color: var(--steak-color);
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.meal-badge-pork {
  background: var(--pork-bg-light);
  color: var(--pork-color);
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.meal-badge-fish {
  background: var(--fish-bg-light);
  color: var(--fish-color);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

/* User Name Tag with Avatar */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  text-transform: uppercase;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-style: italic;
}

/* Real-Time Floating Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.toast {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 280px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: var(--transition);
}

.toast.removing {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

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

/* Footer links */
.footer-nav {
  margin-top: 25px;
  text-align: center;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-nav a:hover {
  color: var(--primary);
}

/* Responsive adjust */
@media(max-width: 768px) {
  body {
    padding: 12px;
  }
  .app-container {
    padding: 24px 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
