/* GidaVeri Phase 1 — MVP styles
   Mirrors coming-soon brand tokens (green accent, gov blue, warn red). */
:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-soft: #ecfdf5;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #22c55e;
  --accent2: #16a34a;
  --warn: #ef4444;
  --warn-bg: #fef2f2;
  --gov: #1d4ed8;
  --gov-bg: #eff6ff;
  --shadow: 0 1px 3px 0 rgba(0,0,0,.04), 0 1px 2px -1px rgba(0,0,0,.04);
}
html[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-card: #131a2b;
  --bg-hover: #1a2238;
  --bg-soft: #0f2a1f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --warn: #f87171;
  --warn-bg: #2a1212;
  --gov: #60a5fa;
  --gov-bg: #0f1830;
  --shadow: 0 1px 3px 0 rgba(0,0,0,.4), 0 1px 2px -1px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: 'Segoe UI', Tahoma, system-ui, sans-serif; }

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px;
}
.brand-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: grid; place-items: center; color: white; font-weight: 900;
}
.brand-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: all .15s; font-family: inherit;
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--accent); }

.lang-menu { position: relative; }
.lang-dropdown {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; min-width: 180px; padding: 6px; box-shadow: var(--shadow);
  display: none; z-index: 60;
}
.lang-menu.open .lang-dropdown { display: block; }
.lang-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; background: none; border: none; color: var(--text);
  text-align: inherit; cursor: pointer; border-radius: 6px; font-family: inherit;
  font-size: 14px; text-decoration: none;
}
.lang-item:hover { background: var(--bg-hover); color: var(--accent); }
.lang-item.active { background: var(--bg-soft); color: var(--accent2); font-weight: 600; }
.flag-img { width: 18px; height: 14px; object-fit: cover; border-radius: 2px; }

/* ===== Hero ===== */
.hero {
  padding: 48px 0 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 900; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}
.hero p { color: var(--text-muted); max-width: 640px; margin: 0 auto; font-size: 16px; }

.stats-row {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-top: 24px;
}
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 999px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.stat-pill strong { color: var(--accent2); font-weight: 800; font-size: 16px; }

/* ===== Filter bar ===== */
.filter-bar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin: 24px 0;
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .filter-bar { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; }
}
.filter-bar input, .filter-bar select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); border-radius: 8px;
  font-family: inherit; font-size: 14px;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.btn-clear {
  background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 8px; font-family: inherit; cursor: pointer;
}
.btn-clear:hover { color: var(--text); border-color: var(--text-muted); }

/* ===== Cards ===== */
.results-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 16px 0; font-size: 14px; color: var(--text-muted);
}
.cards { display: grid; gap: 16px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: all .15s; position: relative;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.badge {
  padding: 3px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-gov { background: var(--gov-bg); color: var(--gov); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-cat { background: var(--bg-soft); color: var(--accent2); }
.card h3 {
  font-size: 17px; line-height: 1.35; font-weight: 800; color: var(--text);
  margin: 4px 0 2px;
}
.card .product { font-size: 14px; color: var(--text-muted); }
.card .meta-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px;
  color: var(--text-muted); margin-top: 4px;
}
.card .meta-row span strong { color: var(--text); font-weight: 600; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.btn-primary {
  background: var(--accent2); color: white; border: none; padding: 9px 14px;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-family: inherit;
  font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  flex: 1; justify-content: center;
}
.btn-primary:hover { background: var(--accent); color: white; text-decoration: none; }
.btn-secondary {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 8px; font-weight: 600; cursor: pointer;
  font-family: inherit; font-size: 13px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }

.empty-state {
  text-align: center; padding: 48px 16px; color: var(--text-muted);
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: 12px;
}

/* ===== Detail page ===== */
.detail-back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0; font-size: 14px; }
.detail-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; margin: 16px 0;
}
.detail-card h1 { font-size: 26px; margin: 14px 0 6px; color: var(--text); }
.detail-card .lead { color: var(--text-muted); font-size: 15px; margin-bottom: 18px; }
.detail-grid {
  display: grid; gap: 12px; grid-template-columns: 1fr;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin: 18px 0;
}
@media (min-width: 600px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }
.detail-row { display: flex; flex-direction: column; gap: 4px; }
.detail-row .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
}
.detail-row .value { font-size: 15px; font-weight: 600; color: var(--text); word-break: break-word; }
.detail-disclaimer {
  background: var(--gov-bg); border: 1px solid rgba(29, 78, 216, .25);
  color: var(--gov); padding: 14px; border-radius: 10px; font-size: 13px; margin: 18px 0;
}
html[data-theme="dark"] .detail-disclaimer { color: var(--text); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.share-row a, .share-row button {
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.share-row a:hover, .share-row button:hover {
  border-color: var(--accent); color: var(--accent2);
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 64px; padding: 32px 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px;
}
.footer-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-legal-note { font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.footer-tvp-link { color: var(--accent2); font-weight: 600; }
.footer-bottom {
  border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px;
  text-align: center; font-size: 12px; color: var(--text-muted);
}

/* ===== Misc ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 100; box-shadow: var(--shadow); opacity: 0;
  transition: opacity .2s;
}
html[dir="rtl"] .toast { transform: translateX(50%); }
.toast.show { opacity: 1; }
