/* style.css - FIXED flush tabs + preserved header/stats look & feel */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #0a0f1a 0%, #0c1915 100%);
  color: #e8ffea;
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header - preserved padding & stats look, fixed height for tabs ───── */
.header {
  background: rgba(8, 14, 22, 0.97);
  backdrop-filter: blur(18px);
  padding: 16px 20px;               /* ← kept nice padding */
  border-bottom: 1px solid rgba(102, 187, 106, 0.3);
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;                     /* ← exact height so tabs stick flush */
}

.logo {
  font-size: 2.1rem;
  font-weight: 900;
  background: linear-gradient(90deg, #66bb6a, #a5d6a7, #dcedc8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(102,187,106,0.6));
}

.stats-toggle {
  background: rgba(102, 187, 106, 0.15);
  border: 1px solid rgba(102, 187, 106, 0.4);
  border-radius: 999px;
  padding: 10px 18px;               /* ← slightly bigger for comfort */
  cursor: pointer;
  transition: all 0.28s;
}

.stats-toggle:hover, .stats-toggle.expanded {
  background: rgba(102, 187, 106, 0.3);
  box-shadow: 0 0 24px rgba(102,187,106,0.45);
}

.stats-collapsed {
  display: flex;
  gap: 12px;                        /* ← better spacing between pills */
  align-items: center;
}

.stats-expanded {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.stats-toggle.expanded .stats-expanded { display: flex; }
.stats-toggle.expanded .stats-collapsed { display: none; }

.stat-pill {
  background: rgba(20, 40, 32, 0.88);
  border: 1px solid rgba(129, 199, 132, 0.35);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 1px 5px rgba(0,0,0,0.5);
}

.stat-value {
  color: #a5d6a7;
  font-weight: 900;
}

.level-progress {
  width: 120px;                     /* ← wider so it doesn't feel squished */
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-left: 10px;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #66bb6a, #a5d6a7);
  transition: width 0.7s ease;
}

/* ── Tabs - perfectly flush, no gap below header ─────────────── */
.sidebar-tabs {
  position: sticky;
  top: 68px;                        /* ← exactly matches .header height */
  background: rgba(8, 14, 22, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(102, 187, 106, 0.28);
  padding: 14px 18px;               /* ← consistent padding */
  margin: 0;                        /* no extra margin causing gap */
  z-index: 250;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sidebar-tabs::-webkit-scrollbar { display: none; }

.sidebar-tab {
  padding: 12px 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(102, 187, 106, 0.25);
  border-radius: 14px;
  color: #ddd;
  font-weight: 700;
  font-size: 1.04rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.26s ease;
  flex-shrink: 0;
}

.sidebar-tab:hover {
  background: rgba(102, 187, 106, 0.22);
  color: white;
  transform: translateY(-1px);
}

.sidebar-tab.active {
  background: linear-gradient(145deg, #66bb6a, #4caf50);
  color: white;
  border: none;
  box-shadow: 0 6px 22px rgba(102, 187, 106, 0.6);
  transform: translateY(-2px);
}

/* ── Main content starts right after tabs ───────────────────── */
.grow-area {
  padding: 24px 18px 140px;         /* ← reduced top padding since tabs are sticky */
  background: radial-gradient(circle at 20% 80%, rgba(102,187,106,0.06), transparent 70%);
}

/* ── Panels, cards, buttons, grid, bottom nav, etc. (your previous styles kept + minor polish) ── */

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeUp 0.45s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: none; }
}

h3 {
  text-align: center;
  color: #c8e6c9;
  font-weight: 800;
  font-size: 1.7rem;
  margin: 0 0 28px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.card {
  background: rgba(18, 32, 42, 0.86);
  border: 1px solid rgba(102,187,106,0.32);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #a5d6a7;
  box-shadow: 0 16px 48px rgba(102,187,106,0.3);
}

.btn {
  width: 100%;
  padding: 16px;
  margin: 10px 0;
  border: none;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.12rem;
  cursor: pointer;
  background: linear-gradient(145deg, #81c784, #66bb6a);
  color: white;
  box-shadow: 0 8px 28px rgba(102,187,106,0.55);
  transition: all 0.22s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.btn:active {
  transform: scale(0.94) translateY(4px);
  box-shadow: 0 4px 14px rgba(102,187,106,0.4);
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

/* Plant grid & slots */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.plant-slot {
  background: rgba(12, 28, 22, 0.78);
  border: 2px dashed rgba(102, 187, 106, 0.48);
  border-radius: 22px;
  padding: 18px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.28s ease;
}

.plant-slot:hover {
  border-color: #c8e6c9;
  box-shadow: 0 0 36px rgba(102,187,106,0.45);
  transform: scale(1.04);
}

.plant-visual {
  font-size: 7.5rem;
  filter: drop-shadow(0 12px 36px rgba(102,187,106,0.8));
}

/* Empty slot */
.plant-slot.empty {
  background: linear-gradient(to bottom, #1b3327, #0f1f18);
  border: 2px dashed #81c78477;
  color: #c8e6c9;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 14, 22, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(102, 187, 106, 0.32);
  display: flex;
  padding: 10px 0;
  z-index: 200;
  transition: opacity 0.35s ease;
}

.bottom-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

.nav-item {
  flex: 1;
  text-align: center;
  color: #ccc;
  font-size: 0.88rem;
  font-weight: 700;
}

.nav-item.active {
  color: #dcedc8;
  transform: scale(1.15);
}

.nav-item span {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 4px;
}

/* Notification */
.notification {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(102, 187, 106, 0.95);
  padding: 22px 40px;
  border-radius: 36px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.75);
  z-index: 1000;
  font-weight: 800;
  font-size: 1.35rem;
  display: none;
  max-width: 90%;
  text-align: center;
  border: 2px solid #dcedc8;
}

/* Floating leaves */
.floating-leaves {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.leaf {
  position: absolute;
  font-size: 3rem;
  opacity: 0.22;
  animation: float 50s linear infinite;
}

@keyframes float {
  0%   { transform: translateY(130vh) rotate(0deg) scale(0.5); }
  100% { transform: translateY(-70vh) rotate(2520deg) scale(1.5); }
}
/* Modal styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: rgba(12, 28, 22, 0.94);
    border: 2px solid #66bb6a;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 2.2rem;
    color: #a5d6a7;
    cursor: pointer;
    font-weight: 900;
}

.close:hover {
    color: white;
    transform: scale(1.2);
}

.refill-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
    margin-left: 12px;
    background: linear-gradient(145deg, #2196f3, #64b5f6);
}

.refill-btn.urgent {
    background: linear-gradient(145deg, #f44336, #ef5350);
    box-shadow: 0 0 20px rgba(244,67,54,0.6);
}

/* Slightly better spacing in modal */
#modal-body h3 {
    margin-top: 0;
}

#modal-body p {
    margin: 8px 0;
}