/* ===================================================================
   NOKTA.MA - Style principal
   Portail de Curiosités, Faits Insolites & Culture Générale
   =================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --whatsapp: #25d366;
  --whatsapp-hover: #1da851;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --max-width: 1200px;
  --transition: all 0.25s ease-in-out;
}

[data-theme="dark"] {
  --bg: #090d16;
  --surface: #131b2e;
  --surface-alt: #1a243b;
  --border: #222f4a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary-light: rgba(37, 99, 235, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* NAVIGATION & HEADER */
.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-dot {
  color: var(--primary);
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* HERO & GENERATEUR DE CURIOSITE */
.hero-section {
  padding: 48px 0 32px;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-title span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 36px;
}

.random-fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto 40px;
  position: relative;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.random-fact-card::before {
  content: "💡";
  position: absolute;
  top: -18px;
  left: 32px;
  font-size: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.fact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.fact-category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--primary);
  border: 1px solid var(--border);
}

.fact-counter {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 600;
}

.fact-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 14px;
}

.fact-detail {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.fact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

/* ADSENSE SLOTS */
.ad-slot-wrapper {
  margin: 32px 0;
  text-align: center;
}

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

.ad-placeholder {
  background-color: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 auto;
}

.ad-placeholder.leaderboard {
  max-width: 970px;
  min-height: 90px;
}

.ad-placeholder.rectangle {
  max-width: 336px;
  min-height: 280px;
}

.ad-placeholder.in-article {
  max-width: 728px;
  min-height: 120px;
}

/* GRILLE D'ARTICLES & CATEGORIES */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

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

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-main);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.read-more {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* QUIZ INTERACTIF */
.quiz-section {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin: 48px 0;
  box-shadow: var(--shadow-md);
}

.quiz-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 32px;
}

.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.quiz-question-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-opt-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.quiz-opt-btn.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
  font-weight: 700;
}

.quiz-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.quiz-feedback {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
  font-size: 0.92rem;
  display: none;
}

/* ARTICLES DETAILLES */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin: 36px 0;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 12px;
}

.article-content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  color: var(--text-main);
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-callout {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 18px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0;
  font-style: italic;
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  display: inline-block;
}

/* PAGES LEGALES & CONTACT */
.legal-page-container {
  max-width: 860px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}

.legal-page-container h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.legal-page-container h2 {
  font-size: 1.35rem;
  margin: 28px 0 12px;
  color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* FOOTER */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 12px;
  max-width: 320px;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 12px;
}

/* BANNIERE COOKIES */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 680px) {
  .main-nav .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow-md);
  }
  
  .main-nav.open .nav-links {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .random-fact-card {
    padding: 24px 18px;
  }
  
  .fact-text {
    font-size: 1.15rem;
  }
  
  .hero-title {
    font-size: 1.7rem;
  }
}

/* ===================================================================
   CALCULATEUR DE CURIOSITES COSMIQUES & BIOLOGIQUES
   =================================================================== */
.calc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin: 48px 0;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.calc-box {
  max-width: 600px;
  margin: 0 auto 32px;
}

.calc-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.calc-input {
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 28px 0;
  text-align: left;
}

.calc-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

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

.calc-card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block;
}

.calc-card-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.calc-card-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}
