* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0e1a14;
  --bg-2: #142420;
  --card: #1a2e22;
  --border: #2e4d3a;
  --accent: #43a047;
  --accent-light: #81c784;
  --accent-dark: #2e7d32;
  --text: #e8f5e9;
  --muted: #a5d6a7;
  --danger: #ef5350;
}
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}
a { color: var(--accent-light); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 90;
  background: rgba(14,26,20,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
}
.logo { font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  color: var(--text); text-decoration: none;
  padding: 8px 14px; border-radius: 8px;
  font-size: 0.95rem; transition: background 0.2s;
}
.nav-links a:hover { background: var(--card); }
.nav-links a.active { background: var(--accent); color: white; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg-2);
    padding: 14px; border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
}

/* ===== HERO / HEADERS ===== */
.hero {
  background: linear-gradient(135deg, #1b5e20, #2e7d32, #43a047);
  padding: 80px 20px 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1), transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 850px; margin: 0 auto; }
.hero h1 { font-size: 3.2rem; margin-bottom: 8px; }
.tagline { font-size: 1.3rem; opacity: 0.95; margin-bottom: 14px; }
.sub { font-size: 1.05rem; opacity: 0.9; margin-bottom: 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.stats { font-size: 0.85rem; opacity: 0.8; }

.page-header {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  padding: 50px 20px 40px;
  text-align: center;
}
.page-header h1 { font-size: 2.2rem; margin-bottom: 6px; }
.page-header p { opacity: 0.9; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 12px 26px;
  border-radius: 10px; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; backdrop-filter: blur(6px); }
.btn-outline { background: transparent; border: 1px solid var(--accent-light); color: var(--accent-light); }
.btn-small { padding: 7px 14px; font-size: 0.85rem; border-radius: 7px; }

/* ===== SECTIONS ===== */
.section-title { text-align: center; font-size: 1.9rem; margin: 50px 0 30px; }
.features, .categories, .cta-strip { max-width: 1300px; margin: 0 auto; padding: 0 20px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px; margin-bottom: 50px;
}
.feature-card {
  background: var(--card); padding: 26px 22px; border-radius: 14px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-icon { font-size: 2.4rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.2rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 60px;
}
.cat-card {
  background: var(--card); padding: 20px 14px; border-radius: 12px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text);
  font-size: 1.6rem; text-align: center; transition: all 0.2s;
}
.cat-card span { display: block; font-size: 0.9rem; margin-top: 6px; color: var(--muted); }
.cat-card:hover { transform: translateY(-3px); border-color: var(--accent-light); background: var(--bg-2); }

.cta-strip {
  text-align: center; padding: 50px 20px; margin-top: 40px;
  background: linear-gradient(135deg, var(--card), var(--bg-2));
  border-radius: 16px; border: 1px solid var(--border);
  margin-bottom: 60px;
}
.cta-strip h2 { font-size: 1.7rem; margin-bottom: 8px; }
.cta-strip p { color: var(--muted); margin-bottom: 20px; }

/* ===== ENCYCLOPEDIA CONTROLS ===== */
.controls {
  max-width: 1300px; margin: 24px auto 8px;
  padding: 0 20px; display: flex; gap: 10px; flex-wrap: wrap;
}
.search-wrap { flex: 2; min-width: 240px; position: relative; }
input, select, textarea {
  width: 100%; padding: 13px 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-size: 1rem; outline: none; font-family: inherit;
  transition: border 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-light); }
select { flex: 1; min-width: 160px; cursor: pointer; }

.suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; margin-top: 4px;
  max-height: 280px; overflow-y: auto; z-index: 50; display: none;
}
.suggestions.active { display: block; }
.suggestion {
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.suggestion:hover { background: #243a2c; }
.suggestion img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.suggestion-text { flex: 1; }
.suggestion-text strong { display: block; }
.suggestion-text em { color: var(--muted); font-size: 0.85rem; }

.tabs {
  max-width: 1300px; margin: 14px auto 0;
  padding: 0 20px; display: flex; gap: 6px; overflow-x: auto;
}
.tab {
  padding: 8px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; white-space: nowrap; font-size: 0.9rem;
  transition: all 0.2s;
}
.tab:hover { border-color: var(--accent-light); }
.tab.active { background: var(--accent); border-color: var(--accent); color: white; }

.grid {
  max-width: 1300px; margin: 20px auto;
  padding: 0 20px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card); border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border); position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(67,160,71,0.25); }
.card img { width: 100%; height: 200px; object-fit: cover; background: var(--bg); display: block; }
.card-body { padding: 12px 14px; }
.card-body h3 { font-size: 1.05rem; margin-bottom: 3px; line-height: 1.3; }
.card-body em { color: var(--accent-light); font-size: 0.85rem; font-style: italic; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.55); border: none; color: white;
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.fav-btn.active { background: #c62828; }

.status-msg { text-align: center; padding: 40px 20px; color: var(--accent-light); font-size: 1rem; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
button.load-more {
  display: block; margin: 24px auto 40px; padding: 12px 32px;
  background: var(--accent); color: white; border: none;
  border-radius: 10px; font-size: 1rem; cursor: pointer;
}
button.load-more:hover { background: var(--accent-dark); }

/* ===== MODAL ===== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.9); z-index: 100;
  overflow-y: auto; padding: 20px;
}
.modal.active { display: block; }
.modal-content {
  background: var(--card); max-width: 900px; margin: 30px auto;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
}
.modal-img-wrap { position: relative; background: #000; }
.modal-img-wrap img { width: 100%; max-height: 520px; object-fit: contain; display: block; }
.modal-body { padding: 24px 28px 30px; }
.modal-body h2 { font-size: 1.8rem; margin-bottom: 4px; }
.modal-body .sci-name { color: var(--accent-light); font-style: italic; font-size: 1.05rem; margin-bottom: 18px; display: block; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.info-box { background: var(--bg); padding: 12px 14px; border-radius: 8px; border-left: 3px solid var(--accent); }
.info-box .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 3px; }
.info-box .value { font-size: 0.95rem; font-weight: 500; }
.section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.section h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--accent-light); }
.section p, .section li { color: #d4e8d6; }
.section ul { padding-left: 20px; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-top: 10px; }
.photo-strip img { height: 100px; width: 130px; object-fit: cover; border-radius: 6px; cursor: pointer; flex-shrink: 0; border: 2px solid transparent; }
.photo-strip img:hover { border-color: var(--accent); }
.conservation { display: inline-block; padding: 4px 10px; border-radius: 14px; font-size: 0.85rem; font-weight: 600; }
.cs-LC { background: #2e7d32; }
.cs-NT { background: #689f38; }
.cs-VU { background: #f9a825; color: #000; }
.cs-EN { background: #ef6c00; }
.cs-CR { background: #c62828; }
.cs-EW, .cs-EX { background: #424242; }
.cs-DD, .cs-NE { background: #546e7a; }
.links a { margin-right: 14px; text-decoration: none; font-size: 0.9rem; }
.links a:hover { text-decoration: underline; }
.close {
  position: fixed; top: 18px; right: 18px;
  background: #c62828; color: white; border: none;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.3rem; cursor: pointer; z-index: 110;
}
.photo-credit {
  font-size: 0.75rem; color: var(--muted);
  padding: 6px 12px; background: rgba(0,0,0,0.6);
  position: absolute; bottom: 0; left: 0; right: 0;
}

/* ===== IDENTIFY PAGE ===== */
.identify-wrap { max-width: 950px; margin: 30px auto; padding: 0 20px; }
.dropzone {
  border: 3px dashed var(--border); border-radius: 16px;
  padding: 60px 30px; text-align: center; background: var(--card);
  cursor: pointer; transition: all 0.2s; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--bg-2); }
.dz-icon { font-size: 3.5rem; margin-bottom: 14px; }
.dropzone h3 { font-size: 1.4rem; margin-bottom: 6px; }
.dropzone p { color: var(--muted); margin-bottom: 20px; }
.dz-tip { margin-top: 18px; font-size: 0.85rem; }

.preview { text-align: center; }
.preview img { max-width: 100%; max-height: 480px; border-radius: 12px; border: 1px solid var(--border); }
.preview-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.identify-status { text-align: center; margin: 26px 0; }
.identify-status .error { color: var(--danger); font-weight: 600; }
.identify-status .success { color: var(--accent-light); font-weight: 600; }
.identify-status .spinner { margin: 12px auto; }

.results-title { text-align: center; margin: 30px 0 20px; font-size: 1.5rem; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; position: relative;
}
.result-card img { width: 100%; height: 200px; object-fit: cover; }
.result-card .no-photo { height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.rank-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: white;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; z-index: 2;
}
.result-body { padding: 14px; }
.result-body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.result-body em { color: var(--accent-light); font-size: 0.85rem; }
.confidence { margin: 12px 0; }
.conf-bar { background: var(--bg); height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.conf-fill { background: var(--accent); height: 100%; transition: width 0.4s; }
.confidence span { font-size: 0.8rem; color: var(--muted); }
.result-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.info-section { margin-top: 50px; padding: 30px; background: var(--card); border-radius: 14px; border: 1px solid var(--border); }
.info-section h2 { margin-bottom: 18px; color: var(--accent-light); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.how-card { background: var(--bg-2); padding: 20px; border-radius: 10px; }
.how-num {
  width: 36px; height: 36px; background: var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 12px;
}
.tip-list { list-style: none; padding-left: 0; }
.tip-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.tip-list li:last-child { border-bottom: none; }

/* ===== BLOG ===== */
.blog-search { max-width: 900px; margin: 30px auto 20px; padding: 0 20px; }
.blog-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.blog-tag {
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 0.85rem;
  transition: all 0.15s;
}
.blog-tag:hover { border-color: var(--accent-light); }
.blog-tag.active { background: var(--accent); border-color: var(--accent); color: white; }

.blog-list {
  max-width: 1200px; margin: 0 auto; padding: 0 20px 50px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.blog-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
  display: flex; flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.blog-card img { width: 100%; height: 200px; object-fit: cover; }
.blog-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.blog-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 0.78rem; margin-bottom: 10px; color: var(--muted); }
.blog-mini-tag { background: var(--bg-2); padding: 3px 8px; border-radius: 8px; color: var(--accent-light); }
.blog-card h2 { font-size: 1.2rem; margin-bottom: 8px; line-height: 1.3; }
.blog-card p { color: var(--muted); font-size: 0.95rem; flex: 1; margin-bottom: 14px; }
.read-more { color: var(--accent-light); font-weight: 600; font-size: 0.9rem; }

.no-results { text-align: center; padding: 40px; color: var(--muted); grid-column: 1/-1; }

/* ===== POST PAGE ===== */
.post-wrap { max-width: 780px; margin: 30px auto; padding: 0 20px; }
.back-link { color: var(--accent-light); text-decoration: none; font-size: 0.9rem; }
.post-header { margin: 20px 0 24px; }
.post-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.post-header h1 { font-size: 2.3rem; line-height: 1.2; margin-bottom: 12px; }
.post-excerpt { color: var(--muted); font-size: 1.1rem; }
.post-hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: 12px; margin-bottom: 26px; }
.post-body { font-size: 1.05rem; line-height: 1.85; color: #e0eee2; }
.post-body p { margin-bottom: 18px; }
.post-body h3 { color: var(--accent-light); margin: 28px 0 12px; font-size: 1.3rem; }
.post-body ul { margin: 14px 0 18px 24px; }
.post-body li { margin-bottom: 6px; }
.post-share {
  margin-top: 50px; padding: 24px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; text-align: center;
}
.related { max-width: 1100px; margin: 20px auto 60px; padding: 0 20px; }
.related h2 { margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.related-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text);
}
.related-card img { width: 100%; height: 140px; object-fit: cover; }
.related-card h3 { padding: 12px 14px; font-size: 1rem; line-height: 1.3; }
.loading-text { text-align: center; padding: 40px; color: var(--muted); }

/* ===== FAQ ===== */
.faq-wrap { max-width: 900px; margin: 30px auto 60px; padding: 0 20px; }
.faq-section { margin-bottom: 36px; }
.faq-section h2 { color: var(--accent-light); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.faq-section details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; padding: 14px 18px;
}
.faq-section summary {
  cursor: pointer; font-weight: 600; font-size: 1.05rem;
  list-style: none; outline: none;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::before { content: '➕ '; margin-right: 8px; color: var(--accent); }
.faq-section details[open] summary::before { content: '➖ '; }
.faq-section details p { margin-top: 12px; color: var(--muted); }

/* ===== CONTACT ===== */
.contact-wrap { max-width: 1000px; margin: 30px auto 60px; padding: 0 20px; }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px; margin-bottom: 40px;
}
.contact-card {
  background: var(--card); padding: 26px; border-radius: 14px;
  border: 1px solid var(--border); text-align: center;
}
.contact-icon { font-size: 2.4rem; margin-bottom: 10px; }
.contact-email {
  display: inline-block; margin-top: 10px; padding: 8px 16px;
  background: var(--bg); border-radius: 8px; word-break: break-all;
}
.contact-form-wrap {
  background: var(--card); padding: 30px; border-radius: 14px;
  border: 1px solid var(--border); margin-bottom: 30px;
}
.form-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.contact-form label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  margin-top: 6px; background: var(--bg);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.contact-extra h3 { color: var(--accent-light); margin: 18px 0 6px; }
.contact-extra p { color: var(--muted); }

/* ===== LEGAL ===== */
.legal-wrap { max-width: 800px; margin: 30px auto 60px; padding: 0 20px; }
.legal-wrap h2 { color: var(--accent-light); margin: 28px 0 10px; }
.legal-wrap p, .legal-wrap li { color: #d4e8d6; margin-bottom: 10px; }
.legal-wrap ul { padding-left: 22px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 40px 20px 20px; margin-top: 30px;
}
.footer-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.footer h4 { color: var(--accent-light); margin-bottom: 12px; }
.footer a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; font-size: 0.92rem; }
.footer a:hover { color: var(--accent-light); }
.footer p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.footer-bottom { max-width: 1200px; margin: 30px auto 0; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; font-size: 0.85rem; color: var(--muted); }
.footer-mini {
  text-align: center; padding: 24px 20px;
  border-top: 1px solid var(--border); margin-top: 40px;
  color: var(--muted); font-size: 0.9rem;
}
.footer-mini a { color: var(--accent-light); text-decoration: none; margin: 0 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 2.2rem; }
  .tagline { font-size: 1.1rem; }
  .page-header h1 { font-size: 1.7rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 0 12px; }
  .card img { height: 140px; }
  .modal-body { padding: 18px; }
  .modal-body h2 { font-size: 1.3rem; }
  .post-header h1 { font-size: 1.6rem; }
  .post-body { font-size: 1rem; }
}

