/* ============================================
   Cricket Quiz - Professional Responsive Styles
   Mobile-first, Tablet, Desktop
   ============================================ */

:root {
  /* Cricket-inspired palette - professional & distinctive */
  --color-primary: #0d3b2c;
  --color-primary-light: #1a5c44;
  --color-primary-dark: #082a1f;
  --color-accent: #c9a227;
  --color-accent-hover: #d4b030;
  --color-success: #2d7a4f;
  --color-error: #c53d43;
  --color-bg: #f8f6f1;
  --color-bg-alt: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 2px 8px rgba(13, 59, 44, 0.08);
  --shadow-md: 0 4px 20px rgba(13, 59, 44, 0.12);
  --shadow-lg: 0 8px 40px rgba(13, 59, 44, 0.15);
  
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App wrapper with subtle cricket field gradient */
.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f0ede6 0%, var(--color-bg) 15%, var(--color-bg) 85%, #e8e4dc 100%);
}

/* ========== HEADER ========== */
.header {
  background: var(--color-primary);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ========== CONTAINER ========== */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: 800px;
}

/* ========== MAIN ========== */
.main {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* ========== SECTIONS ========== */
.section {
  animation: fadeIn 0.4s ease;
}

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

.hidden {
  display: none !important;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.section-desc {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ========== INTRO SECTION ========== */
.quiz-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(13, 59, 44, 0.08);
  min-width: 80px;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-settings {
  text-align: center;
  margin-bottom: 2rem;
}

.timer-settings label {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.timer-settings input {
  width: 80px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 2px solid rgba(13, 59, 44, 0.2);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: var(--font-body);
}

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

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-primary);
  color: white;
  margin-top: 1.5rem;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--color-primary-light);
}

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

.btn-outline:hover,
.btn-outline:focus {
  background: var(--color-primary);
  color: white;
}

.intro-section .btn,
.results-actions {
  display: flex;
  justify-content: center;
}

/* ========== QUIZ SECTION ========== */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.score-display {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.score-display strong {
  color: var(--color-primary);
  font-size: 1.1rem;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg-alt);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.timer-display.warning {
  color: var(--color-error);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.8; }
}

.timer-icon {
  width: 20px;
  height: 20px;
}

.timer-unit {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.8;
}

.progress-bar {
  height: 6px;
  background: rgba(13, 59, 44, 0.12);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

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

.question-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(13, 59, 44, 0.06);
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  background: var(--color-bg);
  border: 2px solid rgba(13, 59, 44, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: rgba(13, 59, 44, 0.04);
}

.option-btn:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 59, 44, 0.2);
}

.option-btn.correct {
  border-color: var(--color-success);
  background: rgba(45, 122, 79, 0.1);
  color: var(--color-success);
}

.option-btn.incorrect {
  border-color: var(--color-error);
  background: rgba(197, 61, 67, 0.08);
  color: var(--color-error);
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.8;
}

.option-label {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 59, 44, 0.1);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-right: 1rem;
}

.option-btn.correct .option-label,
.option-btn.incorrect .option-label {
  background: transparent;
}

.feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.feedback.correct {
  background: rgba(45, 122, 79, 0.12);
  color: var(--color-success);
}

.feedback.incorrect {
  background: rgba(197, 61, 67, 0.1);
  color: var(--color-error);
}

/* ========== RESULTS SECTION ========== */
.results-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.results-score {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.results-percent {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.results-message {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.results-actions .btn {
  width: 100%;
  max-width: 220px;
}

.results-actions .share-link {
  text-decoration: none;
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  max-width: 320px;
}

/* ========== SEO CONTENT SECTION ========== */
.seo-content {
  padding: 2rem 0 3rem;
  background: var(--color-bg-alt);
  border-top: 1px solid rgba(13, 59, 44, 0.08);
}

.seo-content .container-wide {
  padding: 0 1.25rem;
}

.seo-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 1.5rem 0 0.75rem;
}

.seo-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.seo-content strong {
  color: var(--color-primary);
  font-weight: 600;
}

@media (min-width: 768px) {
  .seo-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
  }
  .seo-content h3 {
    font-size: 1.3rem;
  }
  .seo-content p {
    font-size: 1.05rem;
  }
}

/* ========== FOOTER ========== */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  text-align: center;
}

.footer p {
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ========== TABLET (768px+) ========== */
@media (min-width: 768px) {
  .container {
    max-width: 680px;
    padding: 0 2rem;
  }
  
  .section-title {
    font-size: 2.25rem;
  }
  
  .section-desc {
    font-size: 1.1rem;
  }
  
  .quiz-stats {
    gap: 1.5rem;
  }
  
  .stat-card {
    padding: 1.25rem 2rem;
    min-width: 100px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .question-card {
    padding: 2.5rem;
  }
  
  .question-text {
    font-size: 1.25rem;
    margin-bottom: 1.75rem;
  }
  
  .option-btn {
    padding: 1.15rem 1.5rem;
    font-size: 1.05rem;
  }
  
  .results-card {
    padding: 2.5rem;
  }
  
  .results-percent {
    font-size: 3rem;
  }
  
  .results-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* ========== DESKTOP (1024px+) ========== */
@media (min-width: 1024px) {
  .container {
    max-width: 720px;
  }
  
  .header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
  }
  
  .main {
    padding: 2.5rem 0 4rem;
  }
  
  .btn {
    max-width: 320px;
  }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
