/* -------------------------------------------------------
   Blood Donation Eligibility Checker - Styles
   ------------------------------------------------------- */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #7b73ff;
  --green: #34d399;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

/* -------------------------------------------------------
   Layout
   ------------------------------------------------------- */

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

section {
  padding: 2rem 0;
}

section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.25rem;
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* -------------------------------------------------------
   Ad Slots
   ------------------------------------------------------- */

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 2rem 0;
}

/* -------------------------------------------------------
   Disclaimer
   ------------------------------------------------------- */

.disclaimer {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--yellow);
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------
   Cards
   ------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  border-bottom: none;
  display: block;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

/* -------------------------------------------------------
   Country Selector
   ------------------------------------------------------- */

.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.country-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text);
}

.country-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
}

.country-btn.selected {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
}

.country-flag {
  font-size: 2rem;
  line-height: 1;
}

.country-name {
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* -------------------------------------------------------
   Progress Bar
   ------------------------------------------------------- */

#progress-container {
  margin-bottom: 1rem;
}

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

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* -------------------------------------------------------
   Questions
   ------------------------------------------------------- */

.question-subtitle {
  color: var(--text-muted) !important;
  font-size: 0.88rem !important;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-size: 0.93rem;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
  width: 100%;
}

.option-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.06);
}

.option-btn.selected {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
}

.option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

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

.option-radio-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}

.option-btn.selected .option-radio-inner {
  background: var(--accent);
}

/* Number input for questions */
.input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.input-row input {
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  width: 120px;
  appearance: none;
  -webkit-appearance: none;
}

.input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.input-row .unit-toggle {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.unit-toggle button {
  background: var(--surface-2);
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.unit-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.input-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Select for questions */
.question-select {
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-size: 0.93rem;
  width: 100%;
  max-width: 300px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239aa0b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  margin-bottom: 1rem;
}

.question-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* -------------------------------------------------------
   Question Navigation
   ------------------------------------------------------- */

.question-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* -------------------------------------------------------
   Buttons
   ------------------------------------------------------- */

.btn {
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -------------------------------------------------------
   Results
   ------------------------------------------------------- */

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

.results-card h2 {
  display: block;
  border-bottom: none;
  padding-bottom: 0;
}

.results-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.results-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.results-card > p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

#results-details {
  text-align: left;
  margin-bottom: 1.5rem;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.result-item:last-child {
  border-bottom: none;
}

.result-status {
  font-size: 1.1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.result-eligible {
  color: var(--green);
}

.result-ineligible {
  color: var(--red);
}

.result-maybe {
  color: var(--yellow);
}

/* Donation Types Grid */
.donation-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.donation-type-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
}

.donation-type-card.available {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.08);
}

.donation-type-card.unavailable {
  opacity: 0.5;
}

.donation-type-icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.donation-type-name {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.donation-type-freq {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Deferral Info */
#results-deferral {
  text-align: left;
  margin-bottom: 1.5rem;
}

#results-deferral h3 {
  text-align: center;
}

.deferral-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.deferral-reason {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

/* Schedule Links */
.schedule-links {
  margin-bottom: 1.5rem;
}

.schedule-links h3 {
  margin-bottom: 0.75rem;
}

.schedule-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.93rem;
  transition: background 0.2s;
}

.schedule-link:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

/* Results Actions */
.results-actions {
  margin-top: 1rem;
}

/* -------------------------------------------------------
   SEO Content
   ------------------------------------------------------- */

.seo-content {
  color: var(--text-muted);
  line-height: 1.8;
}

.seo-content h2 {
  color: var(--text);
}

.seo-content h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.seo-content p {
  margin-bottom: 0.75rem;
}

.seo-content ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.seo-content li {
  margin-bottom: 0.35rem;
}

/* -------------------------------------------------------
   Utility
   ------------------------------------------------------- */

.hidden {
  display: none !important;
}

/* -------------------------------------------------------
   Transitions
   ------------------------------------------------------- */

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

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

.slide-left {
  animation: slideLeft 0.3s ease;
}

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

.slide-right {
  animation: slideRight 0.3s ease;
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */

@media (max-width: 600px) {
  header h1 {
    font-size: 1.25rem;
  }

  .card {
    padding: 1.25rem;
  }

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

  .donation-types-grid {
    grid-template-columns: 1fr;
  }

  .question-nav {
    flex-direction: column-reverse;
  }

  .question-nav .btn {
    width: 100%;
  }

  .input-row {
    flex-wrap: wrap;
  }
}
