/*
  WorldOfCricket.in - Official Stylesheet
  Clean, accessible, high-performance, mobile-first design system.
  Primary colors: Deep Green (#134e2a), Navy (#0b1b3d), Crisp White (#ffffff), Warm Accents (#f59e0b).
*/

:root {
  --primary: #134e2a;
  --primary-hover: #0d381e;
  --primary-light: #e8f5e9;
  --secondary: #0b1b3d;
  --secondary-light: #1e293b;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  --bg-main: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #134e2a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --primary: #2e7d32;
  --primary-hover: #388e3c;
  --primary-light: #1b3822;
  --secondary: #0f172a;
  --secondary-light: #1e293b;
  --accent: #f59e0b;
  --accent-light: #451a03;
  --text-main: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --bg-main: #0b1322;
  --bg-subtle: #111d33;
  --bg-card: #162440;
  --border-color: #273754;
  --border-focus: #4caf50;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}

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

html {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.section-subtle {
  background-color: var(--bg-subtle);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: #f8fafc;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.lead {
  font-size: 1.15rem;
  line-height: 1.7;
}

/* Navigation Header */
.site-header {
  background-color: var(--secondary);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--primary);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-logo:hover {
  text-decoration: none;
  color: #ffffff;
}

.brand-logo svg {
  width: 34px;
  height: 34px;
}

.brand-tag {
  color: #10b981;
  font-weight: 900;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 992px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-link {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-menu-toggle {
  display: flex;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.4rem;
}

@media (min-width: 992px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  background-color: var(--secondary-light);
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-drawer.open {
  display: flex;
}

.mobile-nav-link {
  color: #e2e8f0;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-link:hover {
  color: #ffffff;
  text-decoration: none;
}

/* Breadcrumb Navigation */
.breadcrumb-bar {
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0;
  font-size: 0.875rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--text-light);
  margin-right: 0.5rem;
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0b1b3d 0%, #134e2a 100%);
  color: #ffffff;
  padding: 4rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  color: #ffffff;
  font-size: 2.75rem;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero p {
  color: #e2e8f0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

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

.btn-accent:hover {
  background-color: #b45309;
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  border-color: #cbd5e1;
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--primary);
}

.btn-outline-white {
  background-color: transparent;
  border-color: #ffffff;
  color: #ffffff;
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Grid & Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1.25rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-amber {
  background-color: var(--accent-light);
  color: #b45309;
}

.badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Calculator Workspace */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .calc-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.calc-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.calc-output-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--secondary);
}

[data-theme="dark"] .form-label {
  color: #e2e8f0;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(19, 78, 42, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-result-box {
  background-color: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(19, 78, 42, 0.2);
}

.result-metric {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  font-family: var(--font-mono);
}

.result-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

.result-breakdown {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.result-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border-color);
}

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

.formula-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
}

.formula-expression {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0.75rem 0;
  overflow-x: auto;
}

/* Statistics Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.table-stats {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.table-stats th {
  background-color: var(--bg-subtle);
  color: var(--secondary);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-color);
}

[data-theme="dark"] .table-stats th {
  color: #f1f5f9;
}

.table-stats td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.table-stats tr:last-child td {
  border-bottom: none;
}

.table-stats tr:hover td {
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .table-stats tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Ad Placement Placeholder Component */
.ad-slot {
  background-color: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  margin: 2rem 0;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}

.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: block;
}

.ad-placeholder-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Affiliate Recommendation Component */
.affiliate-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
}

.affiliate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.affiliate-disclosure {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* Quiz Styles */
.quiz-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.quiz-question {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--secondary);
}

[data-theme="dark"] .quiz-question {
  color: #f8fafc;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quiz-option-btn {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.quiz-option-btn.correct {
  background-color: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  font-weight: 700;
}

.quiz-option-btn.wrong {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

.quiz-explanation {
  background-color: var(--bg-subtle);
  border-left: 3px solid var(--primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* Practice Planner Output */
.practice-plan-sheet {
  background-color: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
}

.plan-phase-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* Printable Score Sheet */
@media print {
  .site-header,
  .site-footer,
  .breadcrumb-bar,
  .btn,
  .ad-slot,
  .theme-toggle-btn,
  .no-print {
    display: none !important;
  }
  
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }
  
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .score-sheet-printable {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    padding: 10px !important;
  }

  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th, td {
    border: 1px solid #000000 !important;
    padding: 4px !important;
    font-size: 9pt !important;
  }
}

/* Footer */
.site-footer {
  background-color: var(--secondary);
  color: #cbd5e1;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
  border-top: 4px solid var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
