/* ============================================================
   CaloRupee Shared Design System
   Theme: Organic Green + Glassmorphism
   Font: Plus Jakarta Sans (headings) + Be Vietnam Pro (body)
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,700&family=Be+Vietnam+Pro:wght@300;400;500;600&display=swap');

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  color: #2a3127;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, .headline {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Organic background (all pages) ────────────────────── */
.organic-bg {
  background-color: #f2f9ea;
  background-image:
    radial-gradient(at 0% 0%, hsla(140,72%,85%,1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(45,93%,90%,1) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(160,72%,85%,1) 0, transparent 50%),
    radial-gradient(at 0% 100%, hsla(140,72%,85%,1) 0, transparent 50%),
    radial-gradient(at 50% 100%, hsla(45,93%,90%,1) 0, transparent 50%),
    radial-gradient(at 100% 100%, hsla(160,72%,85%,1) 0, transparent 50%),
    radial-gradient(circle, rgba(0,106,43,0.07) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 36px 36px;
  background-attachment: fixed;
}

/* ── Glass utilities ────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.32);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
.glass:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.52);
  box-shadow: 0 18px 36px -10px rgba(0,106,43,0.14);
}
.glass-static {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.36);
}
.glass-panel {
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.60);
}

/* ── Shared Navbar ──────────────────────────────────────── */
#sharedNav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.30);
  box-shadow: 0 4px 24px rgba(42,49,39,0.07);
}
#sharedNav .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  max-width: 1536px;
  margin: 0 auto;
}
#sharedNav .nav-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #064e1e;
  font-style: italic;
  letter-spacing: -0.02em;
  text-decoration: none;
}
#sharedNav .nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
#sharedNav .nav-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(6,78,30,0.65);
  text-decoration: none;
  transition: color 0.2s;
}
#sharedNav .nav-links a:hover,
#sharedNav .nav-links a.active {
  color: #006a2b;
}
#sharedNav .nav-links a.active {
  border-bottom: 2px solid #006a2b;
  padding-bottom: 2px;
}
#sharedNav .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#sharedNav .nav-cta {
  background: linear-gradient(135deg, #006a2b, #00914e);
  color: #cfffcf;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,106,43,0.3);
}
#sharedNav .nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,106,43,0.4);
}
/* Hamburger */
#sharedNav .hamburger {
  display: none;
  background: rgba(255,255,255,0.65);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: #064e1e;
  transition: background 0.2s;
}
#sharedNav .hamburger:hover { background: rgba(255,255,255,0.9); }
/* Mobile menu */
#sharedMobileNav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem 1rem;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.4);
}
#sharedMobileNav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  color: #064e1e;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
#sharedMobileNav a:hover { background: rgba(0,106,43,0.08); }

@media (max-width: 767px) {
  #sharedNav .nav-links { display: none; }
  #sharedNav .hamburger { display: flex; }
  body { padding-top: 64px; }
}
@media (min-width: 768px) {
  body { padding-top: 68px; }
}

/* ── Bottom Nav (mobile) ────────────────────────────────── */
#bottomNav { display: none; }
@media (max-width: 767px) {
  #bottomNav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 80;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-top: 1px solid rgba(0,106,43,0.12);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.07);
    padding: 0.3rem 0;
    justify-content: space-around;
    align-items: center;
  }
  #bottomNav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 0.62rem; font-weight: 700;
    color: #575e52; text-decoration: none;
    padding: 0.35rem 0.5rem; border-radius: 0.75rem;
    transition: all 0.2s; min-width: 56px;
  }
  #bottomNav a.active, #bottomNav a:hover {
    color: #006a2b;
    background: rgba(0,106,43,0.09);
  }
  #bottomNav .material-symbols-outlined { font-size: 22px; }
  body { padding-bottom: 72px; }
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #86f898; border-radius: 10px; }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(0,106,43,0.15);
  border-top-color: #006a2b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #006a2b; color: #cfffcf;
  padding: 14px 22px; border-radius: 14px;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,106,43,0.3);
  z-index: 2000;
  animation: toastIn 0.35s cubic-bezier(0.16,1,0.3,1);
}
.toast.error { background: #b02500; box-shadow: 0 8px 24px rgba(176,37,0,0.3); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Micro-interactions ─────────────────────────────────── */
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,106,43,0.12);
}
button { cursor: pointer; transition: all 0.25s cubic-bezier(0.4,0,0.2,1); }
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0); }

/* ── Badge (gamification) ───────────────────────────────── */
.efficiency-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  animation: badgePop 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.badge-gold   { background: linear-gradient(135deg,#ffd700,#ffb300); color: #4a2c00; box-shadow: 0 4px 16px rgba(255,179,0,0.4); }
.badge-silver { background: linear-gradient(135deg,#e0e0e0,#b0bec5); color: #263238; }
.badge-green  { background: linear-gradient(135deg,#006a2b,#00914e); color: #cfffcf; box-shadow: 0 4px 16px rgba(0,106,43,0.3); }
.badge-blue   { background: linear-gradient(135deg,#1565c0,#0288d1); color: #fff; }
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Grocery list ───────────────────────────────────────── */
.grocery-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.5);
  transition: background 0.2s;
}
.grocery-item:hover { background: rgba(255,255,255,0.8); }
.grocery-item input[type=checkbox] { accent-color: #006a2b; width: 18px; height: 18px; cursor: pointer; }
.grocery-item.checked { opacity: 0.5; text-decoration: line-through; }

/* ── Fridge chip ────────────────────────────────────────── */
.fridge-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0,106,43,0.1);
  color: #006a2b; font-size: 0.78rem; font-weight: 700;
  border: 1px solid rgba(0,106,43,0.2);
}
.fridge-chip button { background: none; border: none; padding: 0; color: #b02500; font-size: 1rem; line-height: 1; transform: none; }
.fridge-chip button:hover { transform: none; opacity: 0.7; }

/* ── Input number no-spinner ────────────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
