:root {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  
  --primary: #10b981;
  --secondary: #059669;
  --primary-hover: #047857;
  --bg-color: #f0fdf4;
  --card-bg: rgba(255, 255, 255, 0.98);
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --border-radius: 20px;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.page-container {
  width: 100%;
  max-width: 800px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  width: 100%; /* Ensure card doesn't exceed container */
}

.hero-poster {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  object-fit: cover;
}

.card-content {
  padding: 3rem 2.5rem;
}

.title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-align: center;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 500;
  line-height: 1.5;
}

/* Base button styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
}

.btn-large {
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--primary);
  color: white;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.btn-secondary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.8rem 2rem;
}

.btn-outline:hover {
  background: rgba(16, 185, 129, 0.05);
}

.w-100 {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* Helper spacing */
.mt-4 {
  margin-top: 2rem !important;
}

/* Quiz Specifics */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(16, 185, 129, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.4s ease-out;
}

.question-counter {
  font-size: 0.9rem;
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-align: center;
}

.question-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 2.5rem;
  line-height: 1.3;
}

/* Improved Options Grid Spacing */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.option-btn {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  line-height: 1.4;
  word-wrap: break-word;
}

.option-btn:hover {
  border-color: var(--primary);
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

/* Results */
.highlight-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.result-image-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 2rem auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
  border: 6px solid white;
}

.result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-description {
  font-size: 1.15rem;
  color: var(--text-main);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  white-space: pre-line;
}

/* Social Share Links */
.social-share-buttons {
  margin: 2rem 0;
}
.share-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.share-btns-wrapper {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-social {
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-social:hover {
  transform: translateY(-2px);
  color: white;
}
.btn-fb {
  background: #1877F2;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);
}
.btn-fb:hover {
  background: #166fe5;
}
.btn-tw {
  background: #000000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.btn-tw:hover {
  background: #333333;
}

/* Share Panel */
.share-panel {
  background: #f9fafb;
  border-radius: 16px;
  padding: 2rem;
  margin: 2.5rem 0;
  border: 1px solid #e5e7eb;
}

.share-panel h3 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--primary);
}

.share-panel p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.share-inputs {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: stretch;
}

.share-inputs input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  font-family: monospace;
  font-size: 0.9rem;
  min-width: 0;
}

.share-inputs input:focus {
  outline: none;
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .share-inputs {
    flex-direction: column;
  }
  .share-inputs input {
    text-align: center;
  }
}

.error-banner {
  background: #fee2e2;
  color: #b91c1c;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
  border: 1px solid #fca5a5;
  box-shadow: 0 4px 6px rgba(185, 28, 28, 0.1);
}

.hidden {
  display: none !important;
}

#wbx-powered-by-slot {
  margin-top: auto;
  padding-top: 2rem;
}

/* Mobile Adjustments for Typography and Spacing */
@media (max-width: 600px) {
  .page-container {
    padding: 1rem 0.5rem;
  }
  .card-content {
    padding: 1.5rem 1rem;
  }
  .title {
    font-size: 1.6rem;
  }
  .subtitle {
    font-size: 1.05rem;
  }
  .question-text {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  .btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  .option-btn {
    padding: 1rem;
    font-size: 1rem;
    min-height: 60px;
  }
  .result-description {
    font-size: 1rem;
  }
  .share-panel {
    padding: 1.5rem 1rem;
  }
}
