/* ============================================
   Chloe's Gothic Hobby Gorehouse
   Gothic-Cute Theme Stylesheet
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nunito:wght@400;600;700;800&family=Caveat:wght@600&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-dark: #0d0015;
  --bg-mid: #1a0a2e;
  --bg-card: rgba(45, 27, 61, 0.65);
  --bg-card-hover: rgba(60, 35, 80, 0.8);
  --primary: #c850c0;
  --primary-glow: rgba(200, 80, 192, 0.4);
  --secondary: #ff6b9d;
  --accent: #7b68ee;
  --accent-blue: #4158d0;
  --text-light: #f0e6f6;
  --text-muted: #9a7fb0;
  --text-rose: #e8d5e0;
  --income-green: #50c878;
  --horror-red: #e74c6f;
  --cosy-amber: #f0a05a;
  --creative-violet: #b06aff;
  --community-teal: #4ecdc4;
  --solo-indigo: #7b68ee;
  --border-glass: rgba(200, 80, 192, 0.2);
  --shadow-glow: 0 0 30px rgba(200, 80, 192, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Creepster', cursive;
  --font-body: 'Nunito', sans-serif;
  --font-handwriting: 'Caveat', cursive;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- Animated Background ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(75, 0, 130, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 80, 192, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(65, 88, 208, 0.08) 0%, transparent 50%);
  z-index: -2;
  pointer-events: none;
}

/* ---------- Floating Bats Background ---------- */
.bats-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bat {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0.08;
  animation: floatBat linear infinite;
}

@keyframes floatBat {
  0% {
    transform: translateY(110vh) translateX(0) rotate(0deg) scale(1);
    opacity: 0;
  }
  10% { opacity: 0.08; }
  90% { opacity: 0.08; }
  100% {
    transform: translateY(-10vh) translateX(80px) rotate(360deg) scale(0.6);
    opacity: 0;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

/* ---------- Container ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HERO HEADER
   ============================================ */
.hero {
  text-align: center;
  padding: 80px 24px 50px;
  position: relative;
}

.hero-decor {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  background: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
  letter-spacing: 2px;
  line-height: 1.2;
  margin-bottom: 16px;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

.hero .tagline {
  font-family: var(--font-handwriting);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-rose);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

.hero .subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ---------- Divider ---------- */
.section-divider {
  text-align: center;
  padding: 10px 0;
  font-size: 1.1rem;
  opacity: 0.3;
  letter-spacing: 12px;
  color: var(--primary);
}

/* ============================================
   TOGGLE SECTION
   ============================================ */
.toggle-section {
  display: flex;
  justify-content: center;
  padding: 20px 24px 30px;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  padding: 12px 32px;
  box-shadow: var(--shadow-glow);
}

.toggle-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: default;
  user-select: none;
}

.toggle-label.active {
  color: var(--text-light);
  text-shadow: 0 0 12px var(--primary-glow);
}

.toggle-label .toggle-icon {
  margin-right: 4px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--community-teal), #3db8b0);
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--solo-indigo), var(--accent-blue));
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(28px);
}

.mode-description {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
  min-height: 1.4em;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-section {
  padding: 0 24px 30px;
  max-width: 900px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

#search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--text-light);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Category-specific active colors */
.filter-btn[data-filter="cosy"].active {
  background: linear-gradient(135deg, var(--cosy-amber), #e88d3a);
}
.filter-btn[data-filter="horror"].active {
  background: linear-gradient(135deg, var(--horror-red), #c0392b);
}
.filter-btn[data-filter="creative"].active {
  background: linear-gradient(135deg, var(--creative-violet), #8e44ad);
}
.filter-btn[data-filter="community"].active {
  background: linear-gradient(135deg, var(--community-teal), #2eab9e);
}
.filter-btn[data-filter="solo"].active {
  background: linear-gradient(135deg, var(--solo-indigo), var(--accent-blue));
}

.hobby-count {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.hobby-count span {
  color: var(--secondary);
  font-weight: 700;
}

/* ============================================
   WHEEL OF HOBBIES
   ============================================ */
.wheel-section {
  padding: 30px 24px 50px;
  display: flex;
  justify-content: center;
}

.wheel-outer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.wheel-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.wheel-container {
  position: relative;
  width: 360px;
  height: 360px;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  animation: pointerBounce 1.5s ease-in-out infinite;
}

@keyframes pointerBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}

#hobby-wheel {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(200, 80, 192, 0.3),
    0 0 0 12px rgba(200, 80, 192, 0.1),
    0 0 40px rgba(200, 80, 192, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

#spin-btn {
  padding: 14px 48px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 3px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 25px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

#spin-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  opacity: 0;
  transition: var(--transition);
}

#spin-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 35px rgba(200, 80, 192, 0.4);
}

#spin-btn:hover::before { opacity: 1; }

#spin-btn:active {
  transform: translateY(0) scale(0.98);
}

#spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#spin-btn span { position: relative; z-index: 1; }

.wheel-decor-left,
.wheel-decor-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  opacity: 0.15;
}

.wheel-decor-left { left: -50px; }
.wheel-decor-right { right: -50px; }

/* ============================================
   HOBBY CARDS GRID
   ============================================ */
.hobbies-section {
  padding: 0 24px 60px;
}

.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- Individual Card ---------- */
.hobby-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out both;
}

.hobby-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.hobby-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.hobby-card:hover::before { opacity: 1; }

.hobby-card.expanded {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card Header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 80, 192, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(200, 80, 192, 0.15);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* Category Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tag-cosy { color: var(--cosy-amber); border-color: rgba(240, 160, 90, 0.3); background: rgba(240, 160, 90, 0.1); }
.tag-horror { color: var(--horror-red); border-color: rgba(231, 76, 111, 0.3); background: rgba(231, 76, 111, 0.1); }
.tag-creative { color: var(--creative-violet); border-color: rgba(176, 106, 255, 0.3); background: rgba(176, 106, 255, 0.1); }
.tag-community { color: var(--community-teal); border-color: rgba(78, 205, 196, 0.3); background: rgba(78, 205, 196, 0.1); }
.tag-solo { color: var(--solo-indigo); border-color: rgba(123, 104, 238, 0.3); background: rgba(123, 104, 238, 0.1); }

/* Card Body */
.card-description {
  font-size: 0.9rem;
  color: var(--text-rose);
  line-height: 1.6;
  margin-bottom: 8px;
}

.card-expand-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.hobby-card:hover .card-expand-hint {
  color: var(--secondary);
}

/* Expandable Details */
.card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding-top: 0;
}

.hobby-card.expanded .card-details {
  max-height: 500px;
  padding-top: 16px;
}

.hobby-card.expanded .card-expand-hint {
  display: none;
}

.detail-section {
  padding: 10px 0;
  border-top: 1px solid rgba(200, 80, 192, 0.1);
}

.detail-section:first-child {
  border-top: 1px solid rgba(200, 80, 192, 0.15);
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-text {
  font-size: 0.88rem;
  color: var(--text-rose);
  line-height: 1.5;
}

.income-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(80, 200, 120, 0.12);
  border: 1px solid rgba(80, 200, 120, 0.3);
  color: var(--income-green);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 4px;
}

.bath-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(65, 88, 208, 0.12);
  border: 1px solid rgba(65, 88, 208, 0.25);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ============================================
   RESULT MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-mid);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow:
    0 0 60px rgba(200, 80, 192, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: none;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.visible .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: var(--font-body);
}

.modal-close:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.modal-decor {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 16px;
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.modal-hobby-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  text-align: center;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.modal-body .card-tags {
  justify-content: center;
  margin-bottom: 16px;
}

.modal-body .detail-section {
  margin-bottom: 4px;
}

.modal-spin-again {
  display: block;
  margin: 24px auto 0;
  padding: 10px 32px;
  border: 1px solid var(--primary);
  border-radius: 50px;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-spin-again:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid rgba(200, 80, 192, 0.1);
  margin-top: 40px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-hearts {
  margin-top: 8px;
  font-size: 1.1rem;
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 20px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(200, 80, 192, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-handwriting);
  font-size: 1.3rem;
  color: var(--text-muted);
}

/* ============================================
   NO RESULTS STATE
   ============================================ */
.no-results {
  text-align: center;
  padding: 60px 24px;
  grid-column: 1 / -1;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.no-results-text {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero {
    padding: 50px 16px 30px;
  }

  .hobbies-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .wheel-container {
    width: 280px;
    height: 280px;
  }

  #hobby-wheel {
    width: 280px;
    height: 280px;
  }

  .wheel-decor-left,
  .wheel-decor-right {
    display: none;
  }

  .toggle-container {
    padding: 10px 20px;
  }

  .modal-content {
    padding: 28px 20px;
  }

  .modal-hobby-name {
    font-size: 1.4rem;
  }

  .filter-tags {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  .wheel-container {
    width: 240px;
    height: 240px;
  }

  #hobby-wheel {
    width: 240px;
    height: 240px;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* ---------- Card stagger animation ---------- */
.hobby-card:nth-child(1)  { animation-delay: 0.02s; }
.hobby-card:nth-child(2)  { animation-delay: 0.04s; }
.hobby-card:nth-child(3)  { animation-delay: 0.06s; }
.hobby-card:nth-child(4)  { animation-delay: 0.08s; }
.hobby-card:nth-child(5)  { animation-delay: 0.10s; }
.hobby-card:nth-child(6)  { animation-delay: 0.12s; }
.hobby-card:nth-child(7)  { animation-delay: 0.14s; }
.hobby-card:nth-child(8)  { animation-delay: 0.16s; }
.hobby-card:nth-child(9)  { animation-delay: 0.18s; }
.hobby-card:nth-child(10) { animation-delay: 0.20s; }
.hobby-card:nth-child(11) { animation-delay: 0.22s; }
.hobby-card:nth-child(12) { animation-delay: 0.24s; }
