:root {
  --primary: #2d5a27;
  --primary-light: #4a7c44;
  --accent: #d4e157;
  --bg: #fdfcf8;
  --card-bg: rgba(255, 255, 255, 0.8);
  --text: #1b261e;
  --text-light: #5a6b5e;
  --glass: rgba(255, 255, 255, 0.4);
  --shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(212, 225, 87, 0.1) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(74, 124, 68, 0.05) 0, transparent 50%);
  color: var(--text);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
}

header {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  clip-path: ellipse(150% 100% at 50% 0%);
  width: 100%;
  max-width: 100%;
}

header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
}

header p {
  opacity: 0.9;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: -2rem auto 0;
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 10;
}

.hidden {
  display: none !important;
}

/* Mode Selector - Larger & More Prominent */
.mode-selector {
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 60px;
  padding: 8px;
  margin: 0 auto 40px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: fit-content;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mode-btn {
  background: transparent;
  border: none;
  padding: 15px 40px;
  /* Increased padding */
  color: var(--text-light);
  font-size: 1.1rem;
  /* Increased font-size */
  font-weight: 600;
  cursor: pointer;
  border-radius: 50px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
  transform: scale(1.05);
}

.mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

.controls {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Notification Bell Badge */
.icon-btn {
  position: relative;
}

.icon-btn.notification-active::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  background-color: #4ade80;
  /* Green */
  color: white;
  font-size: 9px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.moon-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.moon-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.moon-info {
  display: flex;
  flex-direction: column;
}

.moon-info strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.moon-info span {
  font-size: 1.1rem;
  font-weight: 500;
}

.location-select {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.select-wrapper {
  flex: 1;
  min-width: 200px;
}

select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(74, 124, 68, 0.1);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filters label {
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filters input {
  display: none;
}

.filters label:has(input:checked) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 90, 39, 0.2);
}

.months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.month {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.month:hover {
  transform: translateY(-8px);
}

.month h2 {
  margin: 0 0 0.5rem 0;
  color: var(--primary);
  font-size: 1.75rem;
}

.focus {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-style: italic;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.category {
  margin-bottom: 1rem;
}

.category strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 0.25rem;
}

.category-content {
  font-size: 0.95rem;
}

footer {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
  }

  .container {
    margin-top: -1rem;
  }
}

/* Modal Styles - CRITICAL FIX */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #fff;
  padding: 3rem;
  border-radius: 2.5rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-modal {
  max-width: 700px;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* Month Navigation */
.month-nav {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 1rem 0 1.5rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.month-nav::-webkit-scrollbar {
  height: 6px;
}

.month-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.month-nav::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 10px;
}

.month-tab {
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.month-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.2);
  transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 3rem;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.dashboard-header {
  margin-bottom: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-main {
  text-align: center;
}

.header-main h2 {
  font-size: 2.5rem;
  margin: 0;
  color: var(--primary);
}

/* Rainfall Stats */
.rainfall-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f0f9ff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #bae6fd;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #0284c7;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0c4a6e;
}

/* Legend Bar */
.legend-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-item img {
  width: 20px;
  height: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Moon Grid Placeholders */
.moon-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  background: rgba(0, 0, 0, 0.02);
  padding: 1.5rem;
  border-radius: 1.5rem;
  justify-content: center;
}

.moon-day {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  /* Maintain layout when outline added */
}

.moon-day.today {
  border-color: #32cd32;
  /* limegreen */
  background: rgba(50, 205, 50, 0.05);
  /* Subtle green tint */
  box-shadow: 0 0 10px rgba(50, 205, 50, 0.1);
}

.moon-day-icon {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.moon-phase-name {
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.5rem;
  letter-spacing: 0.5px;
}

.moon-day-label {
  opacity: 0.7;
}

.moon-day-dow {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-top: 2px;
  margin-bottom: 1px;
  letter-spacing: 0.5px;
}

.activity-icon {
  width: 28px;
  height: 28px;
  margin-top: 4px;
  object-fit: contain;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: help;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.activity-icon:hover {
  transform: scale(1.5) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  z-index: 10;
}

/* Transition Icons */
.activity-icon-group {
  display: flex;
  gap: 2px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.activity-icon-group .activity-icon {
  width: 20px;
  /* Slightly smaller to fit two */
  height: 20px;
  margin-top: 0;
}

/* Rainfall Input */
.rain-input {
  width: 40px;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 0.7rem;
  text-align: center;
  color: #0284c7;
  margin-top: auto;
  padding: 2px 0;
  transition: all 0.2s;
}

.rain-input:hover,
.rain-input:focus {
  border-bottom-color: #38bdf8;
  background: rgba(240, 249, 255, 0.5);
  outline: none;
}

.rain-input::placeholder {
  color: #cad5e0;
}

.celestial-event {
  background: rgba(212, 225, 87, 0.2);
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(212, 225, 87, 0.3);
  position: relative;
}

.event-tag {
  color: var(--primary);
  font-size: 0.5rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
  text-transform: uppercase;
}

.event-tag.eclipse {
  background: var(--accent);
}

.event-tag.solstice {
  background: #fb8c00;
  color: white;
}

.event-tag.equinox {
  background: #43a047;
  color: white;
}

/* Planting vs Planning Sections */
.section-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plant-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.plant-item {
  background: rgba(255, 255, 255, 0.6);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.plant-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.plant-name {
  font-weight: 700;
  color: var(--text);
}

.plant-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  background: var(--primary-light);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.plant-methods {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}

.dashboard-notes {
  margin-top: 2rem;
}

.dashboard-notes textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  transition: all 0.3s ease;
}

.dashboard-notes textarea:focus {
  background: #fff;
  border-color: var(--primary-light);
  outline: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------- */
/* AD PLACEMENTS & LAYOUT GRID (v1.21)                       */
/* --------------------------------------------------------- */

.banner-top {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 2rem;
  overflow: hidden;
}

.banner-bottom {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.placeholder-slot {
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.25);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  letter-spacing: 1px;
  transition: background 0.3s ease;
}

.placeholder-slot:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Fixed Sizes */
.leaderboard-slot {
  width: 728px;
  max-width: 100%;
  height: 90px;
  margin-left: auto;
  margin-right: auto;
}


.skyscraper-slot {
  width: 160px;
  height: 600px;
  position: sticky;
  top: 2rem;
}

.banner-slot {
  width: 468px;
  height: 60px;
  margin-left: auto;
  margin-right: auto;
}

/* Grid Layout */
.layout-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  /* 160px ad + 20px gap/buffer */
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.sidebar-slot {
  display: flex;
  justify-content: flex-start;
  padding-top: 1rem;
  width: 100%;
}

.main-content {
  min-width: 0;
  /* Prevent grid blowout */
  width: 100%;
  max-width: 100%;
}

/* Responsive Ad Behavior */

/* Desktop and larger: 2-column grid with sidebar visible */
@media (min-width: 1001px) {
  .layout-grid {
    grid-template-columns: 180px 1fr;
  }

  .sidebar-slot {
    display: flex;
  }

  .main-content {
    width: 100%;
    margin: 0 auto;
  }
}

/* Mobile and tablets: Single column, no sidebar */
@media (max-width: 1000px) {

  /* Collapse sidebar on smaller desktops/tablets */
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-slot {
    display: none;
    /* Hide sidebar ad when no room */
  }

  .leaderboard-slot {
    /* Scale down header ad if needed, or hide */
    max-width: 100%;
    overflow: hidden;
  }
}

/* v1.27: Category Badges */
.plant-cat-container {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: 0.5rem;
}

.cat-badge {
  background-color: #2e7d32;
  /* Green */
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  text-transform: capitalize;
  font-weight: 500;
}

.plant-methods {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.25rem;
  font-style: italic;
}