/* ===========================================
   SITO - Tests de Personalidad Virales
   =========================================== */

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #222;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: rgba(124, 58, 237, 0.15);
  --success: #10b981;
  --border: #333;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================================
   LAYOUT
   =========================================== */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.container-narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* ===========================================
   HEADER
   =========================================== */

.header {
  text-align: center;
  padding: 30px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.logo span {
  color: var(--accent);
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 5px;
}

/* ===========================================
   HERO (Landing)
   =========================================== */

.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, var(--accent-light) 0%, transparent 100%);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ===========================================
   QUIZ GRID (Landing)
   =========================================== */

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 40px 0 20px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.quiz-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid var(--border);
  animation: fadeIn 0.4s ease-out backwards;
}

/* Stagger animation para cards */
.quiz-card:nth-child(1) { animation-delay: 0s; }
.quiz-card:nth-child(2) { animation-delay: 0.05s; }
.quiz-card:nth-child(3) { animation-delay: 0.1s; }
.quiz-card:nth-child(4) { animation-delay: 0.15s; }
.quiz-card:nth-child(5) { animation-delay: 0.2s; }
.quiz-card:nth-child(6) { animation-delay: 0.25s; }
.quiz-card:nth-child(7) { animation-delay: 0.3s; }
.quiz-card:nth-child(8) { animation-delay: 0.35s; }

.quiz-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.quiz-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.quiz-card-content {
  padding: 16px;
}

.quiz-card-category {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.quiz-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 8px 0;
  line-height: 1.3;
}

.quiz-card-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--text-secondary);
}

.quiz-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===========================================
   TEST PAGE
   =========================================== */

.test-header {
  text-align: center;
  padding: 30px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.test-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.test-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Progress Bar */
.progress-container {
  padding: 20px;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.3s ease;
  border-radius: 3px;
}

.progress-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Question */
.question-container {
  padding: 40px 20px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question-text {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.4;
  transition: opacity 0.15s ease-out;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  transition: opacity 0.15s ease-out;
}

.option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  animation: fadeIn 0.3s ease-out backwards;
}

/* Stagger animation para opciones */
.option-btn:nth-child(1) { animation-delay: 0.1s; }
.option-btn:nth-child(2) { animation-delay: 0.15s; }
.option-btn:nth-child(3) { animation-delay: 0.2s; }
.option-btn:nth-child(4) { animation-delay: 0.25s; }

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

/* ===========================================
   RESULT PAGE
   =========================================== */

.result-container {
  text-align: center;
  padding: 40px 20px;
}

.result-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 30px;
  border: 4px solid var(--accent);
  box-shadow: 0 0 40px var(--accent-light);
}

.result-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--accent);
}

.result-quiz-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.result-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: left;
}

/* Share Buttons */
.share-section {
  margin: 40px 0;
}

.share-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.share-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.share-btn.whatsapp {
  background: #25D366;
  color: white;
}

.share-btn.twitter {
  background: #1DA1F2;
  color: white;
}

.share-btn.facebook {
  background: #1877F2;
  color: white;
}

.share-btn.copy {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* CTA */
.cta-section {
  margin-top: 50px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.cta-section h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.cta-btn {
  display: block;
  background: var(--accent);
  color: white;
  padding: 15px 25px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}

.cta-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.cta-btn.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.cta-btn.secondary:hover {
  border-color: var(--accent);
}

/* ===========================================
   LOADING & EMPTY STATES
   =========================================== */

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* ===========================================
   FOOTER
   =========================================== */

.footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--accent);
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.8rem;
  }

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

  .question-text {
    font-size: 1.2rem;
  }

  .result-title {
    font-size: 1.6rem;
  }

  .share-buttons {
    flex-direction: column;
  }

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