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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

/* Material Symbols Outlined Override */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Glassmorphism Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.35rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.select-control {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.select-control:focus {
  border-color: var(--primary);
}

.icon-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.primary-btn:active {
  transform: translateY(0);
}

/* Main Container */
.main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Hero & Daily Tip Banner */
.hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid var(--border-highlight);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.hero-icon {
  background: var(--primary);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-text {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Search Bar & Categories Filter */
.controls-section {
  margin-bottom: 2rem;
}

.search-box-container {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 1.1rem 0.9rem 2.8rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.category-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.category-chip {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.category-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Food Grid Cards */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.food-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.food-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.food-card-header {
  position: relative;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.food-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.85rem;
}

.badge-veg {
  background: var(--badge-veg-bg);
  color: var(--badge-veg-text);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-nonveg {
  background: var(--badge-nonveg-bg);
  color: var(--badge-nonveg-text);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.food-card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.food-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.food-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.macro-mini-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.macro-mini-item {
  text-align: center;
}

.macro-mini-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.macro-mini-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.detail-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: var(--bg-secondary);
  z-index: 210;
  box-shadow: var(--shadow-lg);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.detail-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.drawer-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.drawer-body {
  padding: 1.5rem;
  flex: 1;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.macro-grid-full {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.macro-card-full {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.macro-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.macro-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.macro-val {
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-bar-bg {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.benefit-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
}

.benefit-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.benefit-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ai-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.ai-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.ai-action-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Chat Drawer */
.chat-drawer {
  position: fixed;
  bottom: 0;
  right: 1.5rem;
  width: 420px;
  height: 580px;
  max-width: calc(100vw - 3rem);
  max-height: calc(100vh - 2rem);
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 220;
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.chat-drawer.open {
  transform: translateY(0);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

/* Chatbot Markdown Table & Format Styling */
.chat-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.chat-bubble th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.chat-bubble th:first-child {
  text-align: left;
}

.chat-bubble th:last-child {
  text-align: right;
}

.chat-bubble td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-bubble td:first-child {
  text-align: left;
  font-weight: 500;
}

.chat-bubble td:last-child {
  text-align: right;
  font-weight: 600;
  color: #ffffff;
}

.chat-bubble tr:last-child td {
  border-bottom: none;
}

.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, .chat-bubble h4 {
  margin: 0.85rem 0 0.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-bubble h3 {
  font-size: 1.05rem;
}

.chat-bubble ul, .chat-bubble ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.chat-bubble li {
  margin-bottom: 0.35rem;
}

/* Chatbot Starter Chips & Interactive Actions */
.chat-starter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-starter-chip:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.chat-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
}

.chat-action-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.chat-action-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.chat-followup-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.chat-followup-chip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--primary);
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-followup-chip:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.chat-input-area {
  padding: 0.85rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary);
}

/* Legal Disclaimer Footer & Links */
.app-footer {
  max-width: 1280px;
  margin: 3rem auto 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* AdSense Container Placeholder */
.adsense-container {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin: 1.75rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Voluntary UPI Donation Card */
.donation-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border-highlight);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2.5rem 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.donation-content {
  flex: 1;
  min-width: 260px;
}

.donation-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.donation-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.upi-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Legal Drawer Modal */
.legal-drawer {
  position: fixed;
  top: 0;
  left: -550px;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: var(--bg-secondary);
  z-index: 230;
  box-shadow: var(--shadow-lg);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.legal-drawer.open {
  left: 0;
}

