/* ══════════════════════════════════════════════
   AI INSPIRE GENERATOR — style.css
   Author: Valli | Portfolio Project 2025
   Aesthetic: Refined Dark Luxury with Warm Gold Accents
   Fonts: Playfair Display (headings) + DM Sans (body)
══════════════════════════════════════════════ */

/* ── CSS Variables (Design Tokens) ── */
:root {
  /* Dark theme (default) */
  --bg: #0a0a0f;
  --bg-2: #111118;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(212, 175, 55, 0.4);

  --text-primary: #f0ece0;
  --text-secondary: #8a8580;
  --text-muted: #4a4845;

  --gold: #d4af37;
  --gold-light: #f0cc55;
  --gold-dim: rgba(212, 175, 55, 0.15);

  --green: #25d366;
  --danger: #e05555;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.5);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg: #f5f0e8;
  --bg-2: #ede8df;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(180, 130, 20, 0.5);

  --text-primary: #1a1710;
  --text-secondary: #6b6558;
  --text-muted: #b0a898;

  --gold: #b8860b;
  --gold-light: #d4a017;
  --gold-dim: rgba(184, 134, 11, 0.12);

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ══════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(245, 240, 232, 0.8);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  color: var(--gold);
  font-size: 1.1rem;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 0.9rem;
  transition: all var(--transition);
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--gold);
  color: #000;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid; place-items: center;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 4rem;
  overflow: hidden;
}

/* Animated orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: float 10s ease-in-out infinite alternate;
  pointer-events: none;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #d4af37, transparent 70%);
  top: -100px; left: -100px;
  animation-duration: 12s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7b5ea7, transparent 70%);
  bottom: -80px; right: -80px;
  animation-duration: 9s;
  animation-delay: -3s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #4a9eff, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 15s;
  animation-delay: -6s;
}

@keyframes float {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-30px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: 100px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  background: var(--gold-dim);
  animation: fadeDown 0.8s ease both;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  animation: fadeDown 0.9s ease both 0.1s;
}

.hero-title em {
  font-style: italic;
  color: var(--gold);
  display: block;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  animation: fadeDown 1s ease both 0.2s;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   MAIN CONTAINER
══════════════════════════════════════════════ */
.main-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Controls Bar ── */
.controls-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.category-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.category-select {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #1a1a24;           /* solid dark bg — fixes dropdown visibility */
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  min-width: 200px;
  -webkit-appearance: auto;
  appearance: auto;
}

.category-select:hover,
.category-select:focus {
  border-color: var(--gold);
  background: #22222e;
  color: var(--text-primary);
}

/* ── Dropdown options — dark background fix ── */
.category-select option {
  background: #1a1a24;           /* dark background for each option */
  color: #f0ece0;                /* light text */
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
}

.category-select option:hover,
.category-select option:focus,
.category-select option:checked {
  background: #d4af37;           /* gold highlight when selected */
  color: #111;
}

/* Light theme override for select */
[data-theme="light"] .category-select {
  background: #ffffff;
  color: #1a1710;
  border-color: rgba(0,0,0,0.15);
}

[data-theme="light"] .category-select:hover,
[data-theme="light"] .category-select:focus {
  background: #fff8ee;
  border-color: var(--gold);
}

[data-theme="light"] .category-select option {
  background: #ffffff;
  color: #1a1710;
}

[data-theme="light"] .category-select option:checked {
  background: #d4a017;
  color: #fff;
}

/* ── Quote Card ── */
.quote-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 3rem 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all var(--transition);
  animation: fadeUp 0.7s ease both 0.3s;
}

.quote-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim) 0%, transparent 60%);
  pointer-events: none;
}

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

.card-label {
  display: inline-block;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.quote-marks {
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  color: var(--gold);
  line-height: 0.5;
  margin-bottom: 1rem;
  opacity: 0.5;
  user-select: none;
}

.quote-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  line-height: 1.65;
  font-style: italic;
  color: var(--text-primary);
  min-height: 80px;
  transition: opacity 0.3s ease;
}

.quote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quote-author {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
}

.char-counter {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ── Loading Spinner ── */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

/* Primary */
.btn-primary {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* WhatsApp */
.btn-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  color: var(--green);
  border-color: rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
}

/* Danger */
.btn-danger {
  background: rgba(224, 85, 85, 0.1);
  color: var(--danger);
  border-color: rgba(224, 85, 85, 0.3);
}

.btn-danger:hover {
  background: rgba(224, 85, 85, 0.2);
  border-color: var(--danger);
}

.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.8rem; }

/* ══════════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a24;
  color: #fff;
  border: 1px solid var(--gold);
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  font-size: 0.88rem;
  z-index: 999;
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}

[data-theme="light"] .toast { background: #1a1a24; }

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════
   FAVORITES SECTION
══════════════════════════════════════════════ */
.favorites-section {
  padding-top: 1rem;
  animation: fadeUp 0.7s ease both 0.5s;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i { color: var(--gold); }

.fav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap i {
  position: absolute;
  left: 0.8rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.search-input {
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
  width: 200px;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  color: var(--gold);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state p { font-size: 0.95rem; line-height: 1.8; }

/* Favorites Grid */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Individual Favorite Card */
.fav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition);
  animation: fadeUp 0.4s ease both;
}

.fav-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.fav-card .fav-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  flex: 1;
}

.fav-card .fav-author {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 500;
}

.fav-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.fav-card .fav-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fav-actions { display: flex; gap: 0.4rem; }

.fav-action-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.fav-action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.fav-action-btn.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(224, 85, 85, 0.1);
}

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: grid; place-items: center;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
}

.social-links a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  transform: translateY(-2px);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ══════════════════════════════════════════════
   RESPONSIVE DESIGN
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar { padding: 0.9rem 1.25rem; }

  .hero { padding: 100px 1.25rem 3rem; min-height: 45vh; }

  .main-container { padding: 0 1rem 3rem; }

  .quote-card { padding: 2rem 1.5rem; }

  .quote-marks { font-size: 4rem; }

  .quote-actions { flex-wrap: wrap; }

  .section-header { flex-direction: column; align-items: flex-start; }

  .fav-controls { width: 100%; }

  .search-input { width: 100%; }

  .favorites-grid { grid-template-columns: 1fr; }

  .btn-primary { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .quote-card { padding: 1.5rem 1rem; }
  .category-wrap { flex-direction: column; align-items: flex-start; }
  .category-select { min-width: 100%; }
}

/* ── Smooth page transitions ── */
.quote-text.fading { opacity: 0; transform: translateY(6px); }
.quote-text { transition: opacity 0.25s ease, transform 0.25s ease; }

/* ── Speaking indicator ── */
.btn-speaking {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
  animation: pulse-gold 1.5s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

/* ── Gradient background cycling on quote card ── */
.quote-card.gradient-1::before { background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(123,94,167,0.06) 100%); }
.quote-card.gradient-2::before { background: linear-gradient(135deg, rgba(74,158,255,0.1)  0%, rgba(212,175,55,0.08) 100%); }
.quote-card.gradient-3::before { background: linear-gradient(135deg, rgba(123,94,167,0.1)  0%, rgba(37,211,102,0.06) 100%); }
.quote-card.gradient-4::before { background: linear-gradient(135deg, rgba(37,211,102,0.08) 0%, rgba(212,175,55,0.1)  100%); }
