﻿:root {
  --brand-green: #1b8f5a;
  --brand-green-dark: #0f6c42;
  --bg: #ffffff;
  --panel: #f8faf9;
  --border: #e5e7eb;
  --shadow: 0 18px 45px rgba(0, 64, 32, 0.08);
  --text: #1f2937;
  --muted: #6b7280;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--brand-green); text-decoration: none; }
a:hover { color: var(--brand-green-dark); }


.top-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; }
.top-nav .nav-inner a { color: #e5e7eb; }
.top-nav .nav-inner a:hover { color: #ffffff; }
.top-nav .nav-inner a.text-white { color: #ffffff; }
header { position: relative; background: #2d2d2d; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; }
.navbar { max-width: 1280px; margin: 0 auto; padding: 16px 16px; display: flex; align-items: center; gap: 24px; width: 100%; }
.brand { font-weight: 700; color: #f5f7fb; letter-spacing: 0.2px; font-size: 20px; }
.nav-links { display: flex; gap: 24px; align-items: center; font-size: 14px; margin-left: auto; }
.nav-links a, .nav-links span { color: #f5f7fb; }
.nav-links a:hover { color: #ffffff; text-decoration: underline; }
.nav-links a.active { color: #ffffff; font-weight: 700; }
.small { color: #d1d5dc; font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 88px 16px 60px; }

.hero { background: linear-gradient(135deg, rgba(27,143,90,0.08), rgba(27,143,90,0.02)); border: 1px solid var(--border); padding: 18px; border-radius: 14px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: 26px; }
.hero p { margin: 0 0 10px; color: var(--muted); }
.hero-actions { display: flex; gap: 14px; align-items: center; }
.search-hero { margin-top: -32px; }
.hero-landing { position: relative; overflow: hidden; padding: 28px 26px; margin-bottom: 20px; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(circle at 10% 20%, rgba(27,143,90,0.08), transparent 35%), radial-gradient(circle at 90% 10%, rgba(16,124,65,0.08), transparent 30%), linear-gradient(135deg, rgba(27,143,90,0.08), rgba(27,143,90,0.02)); opacity: 0.9; }
.hero-landing::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(229,231,235,0.5) 1px, transparent 1px), linear-gradient(to bottom, rgba(229,231,235,0.5) 1px, transparent 1px); background-size: 48px 48px; opacity: 0.2; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
.hero-landing h1 { font-size: 32px; font-weight: 800; margin: 6px 0 10px; color: #0f172a; }
.hero-subtitle { font-size: 16.5px; font-weight: 400; line-height: 1.55; margin: 0 0 14px; color: #6b7280; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(27,143,90,0.12); border: 1px solid rgba(27,143,90,0.25); color: #0e6d42; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.hero-pill .pill-detail { font-weight: 600; color: #0f6c42; letter-spacing: normal; text-transform: none; }
.home-hero h1 { font-size: 32px; }
.home-hero { border-radius: 18px; padding: 28px 26px; }

.section-title { margin: 30px 0 12px; font-size: 20px; color: #1f2937; }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.home-overview { margin-top: 36px; }
.home-overview .section-title { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.section-subtitle { margin: 0 0 18px; font-size: 15.5px; color: var(--muted); line-height: 1.55; }
.home-grid { margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.home-grid .card { height: 100%; text-align: left; }
.home-grid .card p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; font-weight: 400; color: #374151; }
.home-grid .card p:last-child { margin-bottom: 0; }
.home-grid .card strong { display: block; font-weight: 600; }

.metrics-band { margin: 8px 0 26px; background: #0f6c42; color: #f5f7fb; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.metric { text-align: center; }
.metric-value { font-size: 20px; font-weight: 800; letter-spacing: 0.2px; }
.metric-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #d1fae5; margin-top: 4px; }

.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 6px 0 12px; }
.cta-card { position: relative; display: flex; gap: 16px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; text-decoration: none; color: inherit; box-shadow: 0 2px 6px rgba(0,0,0,0.05); transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.cta-card:hover { transform: translateY(-2px); border-color: #c5e6d6; box-shadow: 0 6px 14px rgba(27,143,90,0.12); }
.cta-content h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: #0f172a; }
.cta-content p { margin: 0 0 10px; color: #4b5563; line-height: 1.55; font-size: 15px; }
.cta-link { font-weight: 700; color: var(--brand-green-dark); }
.cta-icon { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; background: linear-gradient(135deg, rgba(27,143,90,0.12), rgba(27,143,90,0.04)); border: 1px solid #d9f0e4; position: relative; }
.cta-icon::before, .cta-icon::after { content: ""; position: absolute; inset: 12px; border-radius: 10px; border: 1px solid rgba(16,124,65,0.35); }
.search-icon::before { inset: 10px; border-radius: 50%; }
.paper-icon::before { inset: 10px; border-radius: 6px; }

.card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px 28px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow:
    0 4px 12px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.06);
}
.card h3 { margin: 0 0 8px; font-size: 18px; color: #1f2937; font-weight: 600; }
.card p { margin: 0 0 10px; color: var(--muted); }
.card .meta { font-size: 13px; color: var(--muted); }
.list-links { display: flex; flex-direction: column; gap: 6px; }
.list-links a { color: var(--link); font-weight: 600; }
.list-links a:hover { color: #145a8a; text-decoration: underline; }
.muted-strike { color: var(--muted); text-decoration: line-through; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(27,143,90,0.12); color: #0e6d67; font-weight: 600; border: 1px solid rgba(27,143,90,0.35); font-size: 13px; }

.search-panel { margin-top: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); }
.search-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr); gap: 12px; }
@media (max-width: 900px) { .search-row { grid-template-columns: 1fr; } }
.paper-search-row { grid-template-columns: 1fr; }
.field-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input, .field select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 14px; }
.field input:focus, .field select:focus { outline: 2px solid rgba(27,143,90,0.2); border-color: var(--brand-green); }
.field-group-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.paper-search-row .field-group-inline { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.actions-row { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--brand-green); background: var(--brand-green); color: #fff; font-weight: 600; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(27,143,90,0.2); }
.btn.ghost { background: transparent; color: var(--brand-green); }
.btn.ghost:hover { background: rgba(27,143,90,0.08); }
.btn.secondary { background: #f3f4f6; color: var(--muted); border-color: var(--border); }
.btn.disabled, .btn[disabled] { background: #d1d5db; border-color: #d1d5db; color: #6b7280; cursor: not-allowed; }

.badge { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.badge.accent { border-color: rgba(27,143,90,0.35); background: rgba(27,143,90,0.12); color: var(--brand-green-dark); }

.results-header { margin-top: 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.results-grid { display: flex; flex-direction: column; gap: 10px; }
.result-card { border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.papers-results { margin-top: 12px; }
.result-header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.result-title { font-weight: 700; color: var(--brand-green-dark); font-size: 18px; }
.result-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-meta { font-size: 12px; color: var(--muted); }
.result-tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.small-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--panel); }
.mcq-chip { border-color: rgba(27,143,90,0.35); color: var(--brand-green-dark); background: rgba(27,143,90,0.12); font-size: 15px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-btn { border-radius: 10px; border: 1px solid var(--border); background: #f8faf9; padding: 5px 9px; font-size: 12px; color: var(--muted); cursor: pointer; }
.card-btn:hover { border-color: var(--brand-green); color: var(--brand-green-dark); }
.thumb-wrapper { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--panel); max-height: 220px; display: flex; align-items: center; justify-content: center; }
.thumb-wrapper img { max-width: 100%; max-height: 220px; object-fit: contain; cursor: zoom-in; }
.question-text { font-size: 13px; color: var(--text); white-space: pre-wrap; }

.empty-state { margin-top: 10px; padding: 18px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; color: var(--muted); }
.loading-bar { margin-top: 10px; height: 3px; border-radius: 999px; overflow: hidden; background: #e5e7eb; }
.loading-inner { width: 45%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, rgba(27,143,90,0), rgba(27,143,90,0.9), rgba(27,143,90,0)); animation: loading-slide 1s linear infinite; }
@keyframes loading-slide { 0% { transform: translateX(-60%);} 100% { transform: translateX(160%);} }

.pagination { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pagination-buttons { display: flex; gap: 6px; }
.page-btn { border-radius: 10px; padding: 6px 10px; border: 1px solid var(--border); background: #fff; color: var(--muted); cursor: pointer; }
.page-btn[disabled] { opacity: 0.45; cursor: default; }

.modal-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:50; align-items:center; justify-content:center; }
.modal-box { position:relative; max-width:90%; max-height:90%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.modal-box img { max-width:100%; max-height:80vh; border-radius:12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-close, .modal-prev, .modal-next { position:absolute; background:#fff; border:1px solid var(--border); border-radius:999px; width:32px; height:32px; cursor:pointer; color: var(--muted); }
.modal-close { top:-14px; right:-14px; }
.modal-prev { left:-40px; top:50%; transform:translateY(-50%); }
.modal-next { right:-40px; top:50%; transform:translateY(-50%); }
.modal-caption { margin-top:8px; font-size:12px; color:#f9fafb; text-shadow:0 1px 2px rgba(0,0,0,0.4); }
