/* ================================================================
   Quivla – Styles
   ================================================================ */

:root {
  --bg: #0d0d12;
  --surface: #16161f;
  --border: #2a2a3a;
  --text: #e4e4ef;
  --text-muted: #8888a4;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.25);
  --radius: 12px;
  --font: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ----- HEADER / HERO --------------------------------------------------- */

#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
  transition: min-height 0.4s ease;
}

#hero.compact {
  min-height: auto;
  padding: 2rem 0 1.5rem;
}

.logo {
  font-size: 3.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.tagline {
  color: var(--text-muted);
  margin: 0.5rem 0 2rem;
  font-size: 1.05rem;
}

#hero.compact .tagline {
  display: none;
}

/* ----- SEARCH BAR ------------------------------------------------------ */

#search-form {
  width: 100%;
  max-width: 600px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

#search-input {
  width: 100%;
  padding: 0.9rem 3.2rem 0.9rem 1.2rem;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#search-btn {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

#search-btn:hover {
  color: var(--accent-light);
}

/* Badge "Boosted by AI" */
.badge-ai {
  position: absolute;
  top: -0.95rem;
  right: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ----- RESULTS --------------------------------------------------------- */

#results-section {
  padding-bottom: 3rem;
}

#results-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.result-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.result-card a {
  text-decoration: none;
}

.result-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}

.result-title:hover {
  text-decoration: underline;
}

.result-url {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.result-snippet {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
}

.result-provider {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* ----- LOADER ---------------------------------------------------------- */

#loader {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- ERROR ----------------------------------------------------------- */

#error-box {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  font-size: 0.92rem;
}

/* ----- FOOTER ---------------------------------------------------------- */

footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ----- UTILITAIRES ----------------------------------------------------- */

.hidden {
  display: none !important;
}

/* ----- RESPONSIVE ------------------------------------------------------ */

@media (max-width: 600px) {
  .logo {
    font-size: 2.4rem;
  }
  .tagline {
    font-size: 0.95rem;
  }
  #search-input {
    font-size: 0.95rem;
    padding: 0.8rem 3rem 0.8rem 1rem;
  }
}
