/* ═══════════════════════════════════════════════════
   search.css — Trang tìm kiếm | Theme sáng
   ═══════════════════════════════════════════════════ */

/* ── HERO ── */
.search-hero {
  position: relative;
  min-height: 400px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) var(--page-pad) 52px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 50%, var(--green-900) 100%);
}

.search-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='92'%3E%3Cpolygon points='40,2 78,22 78,70 40,90 2,70 2,22' fill='none' stroke='rgba(134,239,172,0.07)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 80px 92px;
  pointer-events: none;
}
.search-hero::after {
  content: '';
  position: absolute; top: -80px; right: -80px; z-index: 0;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(134,239,172,0.10), transparent 65%);
  pointer-events: none;
}

.hero-title {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900;
  color: #fff; margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero-sub {
  position: relative; z-index: 1;
  color: rgba(255,255,255,0.65); font-size: 0.98rem;
  font-weight: 300; margin-bottom: 32px;
}

/* ── SEARCH BOX ── */
.search-box-wrap {
  position: relative; z-index: 2;
  width: 100%; max-width: 720px; margin: 0 auto 18px;
}
.search-box {
  display: flex; align-items: center;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 0 0 2px rgba(134,239,172,0.3);
  transition: box-shadow 0.2s;
}
.search-box:focus-within {
  box-shadow: 0 8px 48px rgba(0,0,0,0.3), 0 0 0 3px rgba(34,197,94,0.5);
}
#searchInput {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body); font-size: 1.05rem;
  padding: 18px 14px 18px 20px;
}
#searchInput::placeholder { color: #9ca3af; }
#clearBtn {
  background: none; border: none; color: #9ca3af;
  cursor: pointer; font-size: 18px; padding: 0 10px;
  transition: color 0.18s; display: none; line-height: 1;
}
#clearBtn:hover { color: var(--text); }
#searchBtn {
  background: var(--green-600); color: #fff; border: none;
  cursor: pointer; padding: 0 26px; min-height: 58px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  transition: background 0.18s;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; white-space: nowrap;
}
#searchBtn:hover { background: var(--green-700); }
#searchBtn svg { width: 20px; height: 20px; }

/* ── QUICK TAGS ── */
.quick-section {
  position: relative; z-index: 2;
  display: flex; align-items: center; flex-wrap: wrap;
  justify-content: center; gap: 8px;
}
.quick-label { color: rgba(255,255,255,0.45); font-size: 0.8rem; }
.quick-tag {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.20);
  border-radius: 100px; padding: 4px 14px;
  font-size: 0.8rem; font-family: var(--font-mono);
  color: rgba(255,255,255,0.75); cursor: pointer; transition: all 0.18s;
}
.quick-tag:hover {
  background: rgba(134,239,172,0.20); border-color: rgba(134,239,172,0.5); color: #fff;
}
.mode-tag { font-family: var(--font-body); font-weight: 600; padding: 6px 18px; }
.mode-tag.active {
  background: rgba(134,239,172,0.9); border-color: rgba(134,239,172,0.9); color: var(--green-900);
}

/* ── SHORTCUT ICONS ── */
.hero-shortcuts {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 28px;
  margin-top: 40px;
}
.shortcut-item {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  cursor: pointer; transition: transform 0.2s; text-decoration: none;
}
.shortcut-item:hover { transform: translateY(-4px); }
.shortcut-icon {
  width: 62px; height: 62px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; transition: all 0.18s;
}
.shortcut-item:hover .shortcut-icon {
  background: rgba(134,239,172,0.18); border-color: rgba(134,239,172,0.4);
}
.shortcut-label { color: rgba(255,255,255,0.70); font-size: 0.80rem; font-weight: 500; white-space: nowrap; }

/* ── RESULTS AREA ── */
.results-area {
  max-width: 820px; margin: 44px auto 0;
  padding: 0 var(--page-pad) 80px;
}

.state-empty { text-align: center; padding: 64px 0; }
.state-icon  { font-size: 50px; margin-bottom: 14px; opacity: 0.25; }
.state-text  { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }
.state-none  { display: none; text-align: center; padding: 64px 0; }

.state-loading { display: none; text-align: center; padding: 56px 0; color: var(--muted); }
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.65s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-header {
  display: none; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.results-count { color: var(--text2); font-size: 0.88rem; }
.results-count strong { color: var(--accent); }

#resultList { display: none; flex-direction: column; gap: 10px; }

.result-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px;
  display: flex; align-items: center; gap: 18px;
  cursor: pointer; transition: all 0.18s;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
}
.result-item:hover {
  border-color: var(--green-400); background: var(--green-50);
  transform: translateX(4px);
  box-shadow: -3px 0 0 var(--accent), var(--shadow-md);
}
.result-formula {
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600;
  color: var(--accent); min-width: 90px; flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-name { font-weight: 600; font-size: 1rem; margin-bottom: 3px; color: var(--text); }
.result-iupac {
  color: var(--muted); font-size: 0.82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 7px;
}
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.result-arrow {
  color: var(--border2); font-size: 22px; flex-shrink: 0;
  transition: transform 0.18s, color 0.18s;
}
.result-item:hover .result-arrow { transform: translateX(5px); color: var(--accent); }

@media (max-width: 640px) {
  .search-hero { min-height: 340px; }
  .hero-shortcuts { gap: 18px; }
  .shortcut-icon { width: 52px; height: 52px; font-size: 22px; }
  #searchBtn span { display: none; }
  #searchBtn { padding: 0 18px; }
  .results-area { padding: 0 var(--page-pad-sm) 56px; }
}