@tailwind base;
@tailwind components;
@tailwind utilities;

/* ─────────────────────────────────────────────────────────────
   AGRIVOTES — Premium Design System
   ───────────────────────────────────────────────────────────── */

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

/* ── Custom Properties ───────────────────────────────────────── */
:root {
  /* ── Agriculture (Green) Palette ─── */
  --clr-forest:       #1a4a2e;
  --clr-leaf:         #2d6a4f;
  --clr-grass:        #40916c;
  --clr-lime:         #74c69d;
  --clr-mint:         #b7e4c7;
  --clr-gold:         #f4a261;
  --clr-harvest:      #e76f51;
  --clr-soil:         #6b4226;
  --clr-sky:          #eaf4f0;
  --clr-card:         #ffffff;

  /* ── Aquaculture (Ocean Blue) Palette ─── */
  --clr-ocean-deep:   #0a2a4a;
  --clr-ocean:        #1565a0;
  --clr-sea:          #1e88e5;
  --clr-wave:         #29b6f6;
  --clr-foam:         #81d4fa;
  --clr-lagoon:       #b3e5fc;
  --clr-teal:         #00838f;
  --clr-aqua:         #00acc1;
  --clr-reef:         #e0f7fa;

  /* ── Combined Sky Background ─── */
  --clr-bg:           #e8f4f8;

  /* ── Shadows ─── */
  --shadow-sm:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:        0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --shadow-glow-green: 0 0 0 3px rgba(116,198,157,.35);
  --shadow-glow-blue:  0 0 0 3px rgba(41,182,246,.35);
  --shadow-glow:      var(--shadow-glow-green);
  --radius-card:      1rem;
  --radius-btn:       .625rem;
  --transition:       all .22s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--clr-bg);
  color: #1c2b22;
  min-height: 100vh;
}

h1,h2,h3,h4,h5 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

[x-cloak] { display: none !important; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f2; }
::-webkit-scrollbar-thumb { background: var(--clr-grass); border-radius: 999px; }

/* ── Keyframe Animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes slideIn {
  from { opacity:0; transform:translateX(-20px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 0 rgba(64,145,108,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(64,145,108,0); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
@keyframes ticker {
  from { transform: translateX(100%); }
  to   { transform: translateX(-100%); }
}
@keyframes countUp {
  from { opacity:0; transform:scale(.85); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ── Utility Classes ─────────────────────────────────────────── */
.fade-up       { animation: fadeUp .5s ease both; }
.slide-in      { animation: slideIn .4s ease both; }
.float-anim    { animation: float 3s ease-in-out infinite; }
.spin-slow     { animation: spin-slow 8s linear infinite; }
.count-up      { animation: countUp .6s ease both; }

/* Stagger helpers */
.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }

/* ── Header / Nav ────────────────────────────────────────────── */
.agri-header {
  background: linear-gradient(135deg,
    var(--clr-ocean-deep) 0%,
    #0d3b6e 25%,
    var(--clr-forest) 60%,
    #1a5c40 100%);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.agri-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  color: #fff;
  text-decoration: none;
  transition: var(--transition);
}

.agri-logo:hover { opacity: .9; transform: scale(1.02); }
.agri-logo .accent { color: #a8e6cf; }

.agri-nav-link {
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  font-weight: 500;
  padding: .375rem .875rem;
  border-radius: var(--radius-btn);
  transition: var(--transition);
  text-decoration: none;
}
.agri-nav-link:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Pill button in nav */
.nav-vote-btn {
  background: linear-gradient(135deg, #0288d1, var(--clr-teal));
  color: #fff !important;
  font-weight: 700;
  padding: .4rem 1rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(2,136,209,.4);
  animation: pulse-ring-blue 2.5s ease infinite;
}
.nav-vote-btn:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(2,136,209,.6); }

@keyframes pulse-ring-blue {
  0%,100% { box-shadow: 0 0 0 0 rgba(2,136,209,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(2,136,209,0); }
}

/* ── News Ticker ─────────────────────────────────────────────── */
.ticker-wrap {
  background: linear-gradient(90deg,
    var(--clr-ocean-deep) 0%,
    var(--clr-ocean) 40%,
    var(--clr-forest) 70%,
    #1a5c40 100%);
  overflow: hidden;
  white-space: nowrap;
  padding: .45rem 0;
  font-size: .8rem;
  color: var(--clr-foam);
  font-weight: 500;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 45s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }

/* ── Hero Banner ─────────────────────────────────────────────── */
.agri-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}
.agri-hero::before {
  content:'';
  position:absolute;
  inset:0;
  background: linear-gradient(135deg,
    rgba(26,74,46,.92) 0%,
    rgba(45,106,79,.8) 40%,
    rgba(26,74,46,.7) 100%);
  z-index:1;
}
.agri-hero img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.agri-hero .hero-content { position:relative; z-index:2; }

/* ── Cards ───────────────────────────────────────────────────── */
.agri-card {
  background: var(--clr-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(116,198,157,.12);
}
.agri-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(116,198,157,.3);
}

/* Nominee card specifics */
.nominee-card {
  display: flex;
  flex-direction: column;
}
.nominee-card .card-img { position: relative; overflow: hidden; }
.nominee-card .card-img img {
  width: 100%; height: 12rem; object-fit: cover;
  transition: transform .4s ease;
}
.nominee-card:hover .card-img img { transform: scale(1.06); }
.nominee-card .vote-badge {
  position: absolute; top: .625rem; left: .625rem;
  background: linear-gradient(135deg,var(--clr-leaf),var(--clr-grass));
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .25rem .6rem; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nominee-card .rank-badge {
  position: absolute; top: .625rem; right: .625rem;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .25rem .6rem; border-radius: 999px;
}
.nominee-card .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }

/* Vote progress bar */
.vote-bar-wrap { height: 6px; background: #e8f4f0; border-radius: 999px; overflow: hidden; }
.vote-bar {
  height: 100%; background: linear-gradient(90deg, var(--clr-grass), var(--clr-lime));
  border-radius: 999px;
  transition: width .8s ease;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--clr-leaf) 0%, var(--clr-grass) 100%);
  color: #fff;
  font-weight: 700;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(45,106,79,.35);
  font-size: .9rem;
  letter-spacing: .01em;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--clr-forest) 0%, var(--clr-leaf) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(45,106,79,.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--clr-gold), var(--clr-harvest));
  color: #fff; font-weight: 700;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-btn);
  border: none; cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(244,162,97,.4);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(244,162,97,.6);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--clr-grass);
  color: var(--clr-leaf);
  font-weight: 600;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { background: var(--clr-leaf); color: #fff; }

/* ── Search & Filter Bar ─────────────────────────────────────── */
.filter-bar {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(116,198,157,.2);
}
.filter-input {
  padding: .6rem 1rem .6rem 2.5rem;
  border: 1.5px solid #d1e8d9;
  border-radius: var(--radius-btn);
  background: #f8fdf9;
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
  width: 220px;
}
.filter-input:focus {
  border-color: var(--clr-grass);
  box-shadow: var(--shadow-glow);
  background: #fff;
}
.filter-select {
  padding: .6rem 2rem .6rem .875rem;
  border: 1.5px solid #d1e8d9;
  border-radius: var(--radius-btn);
  background: #f8fdf9;
  font-size: .875rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232d6a4f'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  background-size: 1.2rem;
}
.filter-select:focus { border-color: var(--clr-grass); box-shadow: var(--shadow-glow); }

/* ── Stat Widgets ────────────────────────────────────────────── */
.stat-widget {
  background: var(--clr-card);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(116,198,157,.15);
  transition: var(--transition);
}
.stat-widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 3rem; height: 3rem;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--clr-forest); }
.stat-label { font-size: .78rem; font-weight: 500; color: #6b8f7a; margin-top: .15rem; }

/* ── Weather Widget ──────────────────────────────────────────── */
.weather-widget {
  background: linear-gradient(135deg, #1e3a2f, #2d6a4f);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.weather-temp { font-size: 3rem; font-weight: 800; line-height: 1; }
.weather-icon { font-size: 3.5rem; }

/* ── Commodity Prices ────────────────────────────────────────── */
.commodity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 0;
  border-bottom: 1px solid #eaf5ee;
  transition: background .15s;
}
.commodity-row:last-child { border-bottom: none; }
.commodity-row:hover { background: #f0faf4; border-radius: .5rem; padding-left: .5rem; padding-right: .5rem; }
.price-up   { color: #16a34a; font-weight: 700; }
.price-down { color: #dc2626; font-weight: 700; }

/* ── News Cards ──────────────────────────────────────────────── */
.news-card {
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(116,198,157,.12);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(116,198,157,.3);
}
.news-card img { width: 100%; height: 10rem; object-fit: cover; transition: transform .4s ease; }
.news-card:hover img { transform: scale(1.05); }
.news-card .news-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.news-tag {
  display: inline-block;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .2rem .5rem; border-radius: 999px;
}
.tag-local  { background: #dcfce7; color: #15803d; }
.tag-intl   { background: #dbeafe; color: #1d4ed8; }
.tag-tech   { background: #fef3c7; color: #92400e; }
.tag-market { background: #fce7f3; color: #9d174d; }

/* ── Section Headers ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--clr-forest);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 2.5rem; height: 3px;
  background: linear-gradient(90deg, var(--clr-grass), var(--clr-lime));
  border-radius: 999px;
  margin-left: .5rem;
}

/* ── Leaderboard ─────────────────────────────────────────────── */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 0;
  border-bottom: 1px solid #eaf5ee;
  transition: var(--transition);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item:hover { background: #f0faf4; border-radius: .5rem; padding-left:.5rem; padding-right:.5rem; }
.lb-rank {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; flex-shrink: 0;
}
.lb-rank-1 { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; box-shadow: 0 2px 8px rgba(245,158,11,.4); }
.lb-rank-2 { background: linear-gradient(135deg,#94a3b8,#64748b); color:#fff; }
.lb-rank-3 { background: linear-gradient(135deg,#c2855b,#a0522d); color:#fff; }
.lb-rank-n { background: #eef2f0; color: var(--clr-forest); }

/* ── Modal ───────────────────────────────────────────────────── */
.agri-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,30,18,.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.agri-modal {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  width: 100%; max-width: 26rem;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
  animation: fadeUp .25s ease;
}
.modal-input {
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid #d1e8d9;
  border-radius: var(--radius-btn);
  background: #f8fdf9;
  font-size: .9rem;
  outline: none;
  transition: var(--transition);
}
.modal-input:focus { border-color: var(--clr-grass); box-shadow: var(--shadow-glow); background: #fff; }
.modal-label { font-size: .83rem; font-weight: 600; color: var(--clr-forest); margin-bottom: .3rem; display: block; }

/* Price summary box */
.price-summary {
  background: linear-gradient(135deg, #f0faf4, #e6f5ec);
  border: 1px solid #b7e4c7;
  border-radius: .75rem;
  padding: .875rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Admin Sidebar ───────────────────────────────────────────── */
.admin-sidebar {
  background: linear-gradient(180deg, var(--clr-forest) 0%, #122d1e 100%);
  width: 15rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-sidebar-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem .875rem;
  border-radius: .625rem;
  font-size: .875rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: .15rem;
}
.admin-sidebar-link:hover, .admin-sidebar-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.admin-sidebar-link.active { background: var(--clr-grass); color: #fff; }

/* ── Admin Stat Cards ────────────────────────────────────────── */
.admin-stat {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border-left: 4px solid;
  transition: var(--transition);
}
.admin-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.admin-stat.green  { border-color: var(--clr-grass); }
.admin-stat.blue   { border-color: #3b82f6; }
.admin-stat.amber  { border-color: #f59e0b; }
.admin-stat.purple { border-color: #8b5cf6; }

/* ── Table ───────────────────────────────────────────────────── */
.agri-table { width: 100%; border-collapse: collapse; }
.agri-table thead { background: #f0faf4; }
.agri-table th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #5a8067;
  white-space: nowrap;
}
.agri-table td { padding: .75rem 1rem; border-top: 1px solid #eaf5ee; font-size: .875rem; vertical-align: middle; }
.agri-table tbody tr:hover { background: #f8fdf9; }

/* ── Flash / Alerts ──────────────────────────────────────────── */
.alert-success {
  background: #f0fdf4; border: 1px solid #86efac;
  color: #166534; padding: .875rem 1rem; border-radius: .75rem;
  display: flex; align-items: center; gap: .5rem; font-weight: 500;
}
.alert-error {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #991b1b; padding: .875rem 1rem; border-radius: .75rem;
  display: flex; align-items: center; gap: .5rem; font-weight: 500;
}

/* ── Footer ──────────────────────────────────────────────────── */
.agri-footer {
  background: linear-gradient(135deg, var(--clr-forest) 0%, #122d1e 100%);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
}
.footer-link {
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  text-decoration: none;
  transition: color .2s;
}
.footer-link:hover { color: var(--clr-lime); }

/* ── Shimmer Loading ─────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, #e8f4ee 25%, #d4eddc 50%, #e8f4ee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: .5rem;
}

/* ════════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE SYSTEM
   ════════════════════════════════════════════════════════════════ */

/* ── xs (≤480px) — small phones ─────────────────────────────── */
@media (max-width: 480px) {
  /* Hero */
  .agri-hero { min-height: 260px; }
  .agri-hero .hero-content { padding: 2rem 1rem; }

  /* Typography scale */
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.25rem; }
  .stat-value { font-size: 1.2rem; }
  .weather-temp { font-size: 2rem; }
  .weather-icon { font-size: 2.5rem; }

  /* Header */
  .agri-logo { font-size: 1.2rem !important; }

  /* Ticker — speed up on small screens */
  .ticker-inner { animation-duration: 25s; }

  /* Cards */
  .agri-card { border-radius: .75rem; }
  .nominee-card .card-img img { height: 10rem; }

  /* Modal — full screen on tiny phones */
  .agri-modal-overlay { align-items: flex-end; padding: 0; }
  .agri-modal {
    border-radius: 1.25rem 1.25rem 0 0;
    max-width: 100%;
    padding: 1.25rem 1rem 2rem;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* Filter bar */
  .filter-bar { flex-direction: column; align-items: stretch; padding: .75rem; }
  .filter-input,
  .filter-select { width: 100%; }

  /* Stats grid */
  .stat-widget { padding: .875rem 1rem; gap: .75rem; }
  .stat-icon { width: 2.5rem; height: 2.5rem; font-size: 1.1rem; }

  /* Leaderboard */
  .leaderboard-item { gap: .5rem; }

  /* Tables — horizontal scroll with sticky first col */
  .agri-table th,
  .agri-table td { padding: .5rem .625rem; font-size: .8rem; }

  /* Footer */
  .agri-footer { padding: 2rem 0 1rem; }

  /* Admin sidebar hidden on xs */
  .admin-sidebar { display: none !important; }

  /* Commodity rows */
  .commodity-row { padding: .5rem 0; }

  /* News cards */
  .news-card img { height: 8rem; }

  /* Buttons */
  .btn-primary,
  .btn-gold,
  .btn-outline { padding: .625rem 1rem; font-size: .875rem; }
}

/* ── sm (481px–767px) — large phones / phablets ──────────────── */
@media (min-width: 481px) and (max-width: 767px) {
  .agri-hero { min-height: 320px; }
  .stat-value { font-size: 1.4rem; }
  .weather-temp { font-size: 2.2rem; }
  .agri-modal { padding: 1.5rem; max-width: 95vw; }
  .filter-bar { flex-wrap: wrap; }
  .filter-input { flex: 1 1 160px; }
  .filter-select { flex: 1 1 140px; }
  .admin-sidebar { width: 13rem; }
}

/* ── md (768px–1023px) — tablets ────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .agri-hero { min-height: 380px; }
  .admin-sidebar { width: 14rem; }
  .nominee-card .card-img img { height: 11rem; }
  .weather-temp { font-size: 2.6rem; }
}

/* ── Universal Mobile (≤767px) ───────────────────────────────── */
@media (max-width: 767px) {
  /* Ticker */
  .ticker-wrap { font-size: .72rem; padding: .35rem 0; }

  /* Hero adjustments */
  .agri-hero::before {
    background: linear-gradient(160deg,
      rgba(26,74,46,.96) 0%,
      rgba(45,106,79,.85) 60%,
      rgba(26,74,46,.75) 100%);
  }

  /* Section headers */
  .section-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .section-title { font-size: 1.1rem; }
  .section-title::after { display: none; }

  /* Weather widget grid */
  .weather-widget .grid { grid-template-columns: repeat(3, 1fr); }

  /* Commodity table — two column on mobile */
  .commodity-row { flex-wrap: nowrap; }

  /* Farmer toolkit tips — 2 col on sm */
  /* (Tailwind handles this via grid-cols-2) */

  /* Fertiliser guide — make table scrollable */
  .agri-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* News cards — full width */
  .news-card { min-height: auto; }
  .news-body { padding: .75rem; }

  /* Modal quick-select votes row */
  .vote-presets { flex-wrap: wrap; gap: .375rem; }

  /* Admin table — horizontal scroll */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* CTA Banner */
  .cta-banner { padding: 1.5rem; }
  .cta-banner h2 { font-size: 1.25rem; }

  /* Footer columns stack */
  .agri-footer .grid { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Leaderboard two panels stack */
  .leaderboard-grid { grid-template-columns: 1fr !important; }

  /* Admin quick-action buttons */
  .admin-actions { grid-template-columns: 1fr 1fr !important; }

  /* Admin stat cards */
  .admin-stats-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── Touch: remove hover transforms on touch devices ─────────── */
@media (hover: none) {
  .agri-card:hover { transform: none; box-shadow: var(--shadow-md); }
  .news-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .stat-widget:hover { transform: none; box-shadow: var(--shadow-md); }
  .btn-primary:hover,
  .btn-gold:hover { transform: none; }
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
  .agri-header, .ticker-wrap, .agri-footer, .btn-primary,
  .btn-gold, .btn-outline, #nominees, .agri-modal-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .agri-card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Safe area (iPhone notch/home bar) ───────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .agri-modal { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
  .agri-header { padding-top: env(safe-area-inset-top); }
}

/* ════════════════════════════════════════════════════════════════
   AQUACULTURE & FISHERIES THEME COMPONENTS
   ════════════════════════════════════════════════════════════════ */

/* ── Section divider — ocean wave ────────────────────────────── */
.section-divider-ocean {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}
.section-divider-ocean::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clr-wave), transparent);
}
.section-divider-ocean span {
  position: relative;
  background: var(--clr-bg);
  padding: 0 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-sea);
}

/* ── Ocean Card variant ───────────────────────────────────────── */
.ocean-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.ocean-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-wave);
}

/* ── Aquaculture hero variant ─────────────────────────────────── */
.aqua-hero::before {
  background: linear-gradient(135deg,
    rgba(10,42,74,.92) 0%,
    rgba(21,101,160,.8) 40%,
    rgba(26,74,46,.75) 100%) !important;
}

/* ── Water Quality Widget ─────────────────────────────────────── */
.water-widget {
  background: linear-gradient(135deg, var(--clr-ocean-deep), #1565a0);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.water-param {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.water-param:last-child { border-bottom: none; }
.water-param .label { font-size: .78rem; opacity: .75; }
.water-param .value { font-weight: 700; font-size: .9rem; }
.water-param .status-good  { color: #86efac; }
.water-param .status-warn  { color: #fde68a; }
.water-param .status-crit  { color: #fca5a5; }

/* ── Fish Price Ticker ────────────────────────────────────────── */
.fish-price-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid #e0f2fe;
  transition: background .15s;
}
.fish-price-row:last-child { border-bottom: none; }
.fish-price-row:hover {
  background: #f0f9ff;
  border-radius: .5rem;
  padding-left: .5rem;
  padding-right: .5rem;
}
.fish-price-up   { color: #0ea5e9; font-weight: 700; }
.fish-price-down { color: #dc2626; font-weight: 700; }

/* ── Aqua news tag ────────────────────────────────────────────── */
.tag-aqua    { background: #e0f2fe; color: #0369a1; }
.tag-fish    { background: #ecfeff; color: #164e63; }
.tag-fishery { background: #f0f9ff; color: #075985; }

/* ── Category badge — aquaculture ────────────────────────────── */
.badge-aqua {
  background: linear-gradient(135deg, var(--clr-ocean), var(--clr-teal));
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(21,101,160,.35);
}

/* ── Section title ocean variant ─────────────────────────────── */
.section-title-ocean {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--clr-ocean-deep);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title-ocean::after {
  content: '';
  display: block;
  width: 2.5rem; height: 3px;
  background: linear-gradient(90deg, var(--clr-sea), var(--clr-foam));
  border-radius: 999px;
  margin-left: .5rem;
}

/* ── Stat widget ocean variant ────────────────────────────────── */
.stat-widget-ocean {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-widget-ocean:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Footer ocean update ──────────────────────────────────────── */
.agri-footer {
  background: linear-gradient(135deg,
    var(--clr-ocean-deep) 0%,
    #0d3b6e 30%,
    var(--clr-forest) 70%,
    #122d1e 100%) !important;
}

/* ── Nominee card aquaculture variant (blue badge) ────────────── */
.nominee-card.aqua .vote-badge {
  background: linear-gradient(135deg, var(--clr-ocean), var(--clr-teal));
}
.nominee-card.aqua .vote-bar {
  background: linear-gradient(90deg, var(--clr-sea), var(--clr-foam));
}
.nominee-card.aqua .btn-vote {
  background: linear-gradient(135deg, var(--clr-ocean), var(--clr-teal));
}
.nominee-card.aqua .btn-vote:hover {
  background: linear-gradient(135deg, var(--clr-ocean-deep), var(--clr-ocean));
}

/* ── Dual-theme gradient divider ─────────────────────────────── */
.theme-bridge {
  height: 4px;
  background: linear-gradient(90deg,
    var(--clr-leaf) 0%,
    var(--clr-grass) 25%,
    var(--clr-teal) 50%,
    var(--clr-sea) 75%,
    var(--clr-ocean) 100%);
  width: 100%;
}

/* ── Mobile adjustments for aqua components ──────────────────── */
@media (max-width: 480px) {
  .water-widget { padding: 1rem; }
  .water-param .label { font-size: .72rem; }
  .fish-price-row { gap: .5rem; }
}