/* =====================
   AI FINDER — NextAiToday
   css/ai-finder.css
   ===================== */

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

:root {
  --brand-red: #E8442A;
  --brand-ink: #0D0D0D;
  --bg-white: #FFFFFF;
  --bg-sepia: #F5EDD6;
  --card-sepia: #FFFDF5;
  --border-sepia: #D4C89A;
  --text-sepia: #2D2416;
  --text-muted-sepia: #6B5E3E;
  --text-label-sepia: #9B8F72;
  --alt-pill-bg: #EDE4C8;
  --alt-pill-text: #4A3A1E;
}

body {
  font-family: 'Figtree', sans-serif;
  background: var(--bg-white);
  color: var(--brand-ink);
  transition: background 0.3s, color 0.3s;
}

/* Sepia mode (always on by default via class on body) */
body.sepia {
  background: var(--bg-sepia);
  color: var(--text-sepia);
}

/* Night mode */
body.night {
  background: #0D0D0D;
  color: #E8E0D0;
  --card-sepia: #1A1A1A;
  --border-sepia: #333;
  --text-sepia: #E8E0D0;
  --text-muted-sepia: #A89880;
  --text-label-sepia: #7A6A58;
  --alt-pill-bg: #2A2A2A;
  --alt-pill-text: #C8B89A;
  --bg-sepia: #0D0D0D;
}

/* ---- NAVBAR ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--bg-white);
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

body.sepia .navbar { background: var(--bg-sepia); border-color: var(--border-sepia); }
body.night .navbar { background: #111; border-color: #2a2a2a; }

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
  letter-spacing: -0.5px;
}
body.night .nav-logo { color: #E8E0D0; }
.nav-logo span { color: var(--brand-red); }

.nav-back {
  font-size: 13px;
  color: var(--brand-red);
  text-decoration: none;
  font-weight: 500;
}
.nav-back:hover { text-decoration: underline; }

/* ---- BREAKING BAR ---- */
.breaking-bar {
  background: var(--brand-red);
  color: white;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 1rem;
  letter-spacing: 0.3px;
}

/* ---- MAIN ---- */
.finder-main {
  max-width: 660px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.finder-header {
  text-align: center;
  margin-bottom: 2rem;
}

.finder-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-ink);
  margin-bottom: 6px;
}
body.sepia .finder-header h1 { color: var(--text-sepia); }
body.night .finder-header h1 { color: #E8E0D0; }

.finder-header p {
  font-size: 14px;
  color: #666;
}
body.sepia .finder-header p { color: var(--text-muted-sepia); }
body.night .finder-header p { color: #8A7A68; }

/* ---- SEARCH BOX ---- */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Figtree', sans-serif;
  background: #fff;
  color: var(--brand-ink);
  outline: none;
  transition: border-color 0.2s;
}
body.sepia .search-input {
  background: var(--card-sepia);
  border-color: var(--border-sepia);
  color: var(--text-sepia);
}
body.night .search-input {
  background: #1A1A1A;
  border-color: #333;
  color: #E8E0D0;
}
.search-input:focus { border-color: var(--brand-red); }
.search-input::placeholder { color: #aaa; }
body.sepia .search-input::placeholder { color: var(--text-label-sepia); }

.search-btn {
  padding: 13px 24px;
  background: var(--brand-red);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Figtree', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-btn:hover { background: #c93520; }
.search-btn:disabled { background: #c4a98a; cursor: not-allowed; }

/* ---- SUGGESTIONS ---- */
.suggestions {
  text-align: center;
  margin-bottom: 2rem;
}
.suggestions p {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
}
body.sepia .suggestions p { color: var(--text-label-sepia); }

.suggest-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.suggest-pill {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Figtree', sans-serif;
}
body.sepia .suggest-pill {
  background: var(--card-sepia);
  border-color: var(--border-sepia);
  color: var(--alt-pill-text);
}
body.night .suggest-pill {
  background: #1A1A1A;
  border-color: #333;
  color: #C8B89A;
}
.suggest-pill:hover {
  background: var(--brand-red);
  color: white;
  border-color: var(--brand-red);
}

/* ---- LOADING ---- */
.loading-state {
  text-align: center;
  padding: 2.5rem;
  display: none;
}
.loading-state.visible { display: block; }

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #ddd;
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
body.sepia .spinner { border-color: var(--border-sepia); border-top-color: var(--brand-red); }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state p {
  font-size: 14px;
  color: #999;
}
body.sepia .loading-state p { color: var(--text-label-sepia); }

/* ---- ERROR ---- */
.error-state {
  background: #FFF0ED;
  border: 1px solid #F5C4B3;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 14px;
  color: #8B2500;
  display: none;
  margin-bottom: 1.5rem;
}
.error-state.visible { display: block; }

/* ---- RESULT CARD ---- */
.result-card {
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 16px;
  padding: 1.5rem;
  display: none;
  animation: fadeUp 0.3s ease;
}
body.sepia .result-card {
  background: var(--card-sepia);
  border-color: var(--border-sepia);
}
body.night .result-card {
  background: var(--card-sepia);
  border-color: var(--border-sepia);
}
.result-card.visible { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-tool-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-ink);
  margin-bottom: 6px;
}
body.sepia .card-tool-name { color: var(--text-sepia); }
body.night .card-tool-name { color: #E8E0D0; }

.card-category {
  display: inline-block;
  background: rgba(232, 68, 42, 0.12);
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-section {
  padding: 0.9rem 0;
  border-bottom: 1px solid #f0f0f0;
}
body.sepia .card-section { border-color: #EDE4C8; }
body.night .card-section { border-color: #2A2A2A; }

.card-section.last { border-bottom: none; padding-bottom: 0; }


.section-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  color: #111;
  margin-bottom: 6px;
}
body.sepia .section-label { color: #2D2416; }
body.night .section-label { color: #E8E0D0; }

.section-text {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  line-height: 1.65;
}
body.sepia .section-text { color: var(--text-sepia); }
body.night .section-text { color: #C8B89A; }

.alt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.alt-pill {
  background: #f0f0f0;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}
body.sepia .alt-pill {
  background: var(--alt-pill-bg);
  color: var(--alt-pill-text);
}
body.night .alt-pill {
  background: #2A2A2A;
  color: #C8B89A;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 4px;
}
.card-link:hover { text-decoration: underline; }

/* ---- SEPIA BUTTON ---- */
.sepia-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border-sepia, #ddd);
  background: var(--card-sepia, #fff);
  font-size: 18px;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.sepia-btn:hover { transform: scale(1.1); }

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .finder-main { padding: 1.5rem 1rem 3rem; }
  .finder-header h1 { font-size: 22px; }
  .search-box { flex-direction: column; }
  .search-btn { width: 100%; }
  .result-card { padding: 1.25rem; }
}