/*
Theme Name: Mrwill Quiz
Theme URI: https://mrwillquiz.com
Author: Alwyn Abishek
Author URI: https://mrwillquiz.com
Description: A fast, mobile-first quiz and trivia theme inspired by Kahoot. Built for speed, SEO, and AdSense. No page builder required.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: mrwillquiz
Tags: quiz, trivia, education, mobile-first, fast, seo-ready
*/

/* ─── CSS VARIABLES ───────────────────────── */
:root {
  --purple: #46178F;
  --purple-light: #5A2DA5;
  --purple-dark: #350F6B;
  --green: #26890C;
  --blue: #1368CE;
  --red: #E21B3C;
  --yellow: #FFA602;
  --pink: #D4145A;
  --teal: #0AA18F;
  --indigo: #4338CA;
  --amber: #D97706;
  --bg: #F9F5FF;
  --card: #FFFFFF;
  --text: #1A0A2E;
  --text-light: #6B5B7B;
  --border: #E8DEF8;
  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Quicksand', 'Segoe UI', sans-serif;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
}

/* ─── RESET & BASE ────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
button:active { transform: scale(0.97); }

/* ─── TYPOGRAPHY ──────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 800; }
h2 { font-size: clamp(22px, 3.5vw, 32px); font-weight: 800; }
h3 { font-size: clamp(17px, 2.5vw, 22px); }
p { margin-bottom: 1em; }

/* ─── LAYOUT ──────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { padding: 40px 0; }

/* ─── HEADER / NAV ────────────────────────── */
.site-header {
  background: var(--purple);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 20px rgba(70,23,143,0.3);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1200px; margin: 0 auto; padding: 0 16px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 800; font-size: 20px; color: #fff;
}
.site-logo img { height: 36px; width: auto; }
.nav-menu { display: flex; gap: 4px; align-items: center; list-style: none; }
.nav-menu a {
  color: #fff; padding: 8px 16px; border-radius: 8px;
  font-weight: 600; font-size: 14px; transition: background 0.2s;
}
.nav-menu a:hover, .nav-menu .current-menu-item a { background: rgba(255,255,255,0.2); }
.nav-signin {
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.5);
  color: #fff; padding: 8px 20px; border-radius: 20px;
  font-weight: 700; font-size: 14px; margin-left: 8px;
}

/* Mobile menu */
.mobile-toggle {
  display: none; background: none; border: none;
  color: #fff; font-size: 28px; padding: 8px;
}
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 200;
}
.mobile-menu.active { display: block; }
.mobile-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.mobile-drawer {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 80%; max-width: 320px; background: var(--purple);
  padding: 20px 0; overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.mobile-menu.active .mobile-drawer { transform: translateX(0); }
.mobile-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px 20px;
}
.mobile-drawer-header span { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: #fff; }
.mobile-close { background: none; border: none; color: #fff; font-size: 28px; padding: 8px; }
.mobile-drawer a {
  display: block; color: #fff; padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 600; font-size: 17px; transition: background 0.2s;
}
.mobile-drawer a:hover { background: rgba(255,255,255,0.15); }
.mobile-social { padding: 20px 24px; display: flex; gap: 12px; }
.mobile-social a {
  width: 40px; height: 40px; background: rgba(255,255,255,0.15);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; border: none; padding: 0;
}

@media (max-width: 768px) {
  .nav-menu, .nav-signin { display: none; }
  .mobile-toggle { display: block; }
}

/* ─── HERO ────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 50%, var(--indigo) 100%);
  border-radius: 0 0 32px 32px; padding: 48px 24px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; font-size: 80px; opacity: 0.08;
}
.hero::before { content: '❓'; top: 20px; left: 20px; }
.hero::after { content: '🏆'; bottom: 20px; right: 20px; }
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero h1 span { color: var(--yellow); }
.hero p { color: rgba(255,255,255,0.85); font-size: clamp(15px, 2.5vw, 18px); max-width: 600px; margin: 0 auto 28px; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--green); color: #fff; border: none;
  padding: 14px 32px; border-radius: 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(38,137,12,0.4); transition: transform 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6);
  padding: 14px 32px; border-radius: 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  transition: background 0.2s;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }

/* ─── CATEGORY CARDS ──────────────────────── */
.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.category-card {
  border-radius: var(--radius); padding: 24px 16px; text-align: center;
  color: #fff; transition: transform 0.2s; cursor: pointer;
}
.category-card:hover { transform: scale(1.05); }
.category-card .emoji { font-size: 36px; margin-bottom: 8px; }
.category-card .name { font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.category-card .count { font-size: 12px; opacity: 0.85; margin-top: 4px; }

/* ─── QUIZ CARDS ──────────────────────────── */
.quiz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.quiz-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.quiz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quiz-card-header { padding: 28px 20px; position: relative; }
.quiz-card-header .emoji { font-size: 40px; }
.quiz-card-type {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.25); backdrop-filter: blur(4px);
  border-radius: 8px; padding: 4px 10px; font-size: 11px; color: #fff; font-weight: 700;
}
.quiz-card-body { padding: 16px 20px; }
.quiz-card-body h3 { margin-bottom: 8px; line-height: 1.3; }
.quiz-card-body .excerpt { color: var(--text-light); font-size: 13px; line-height: 1.4; margin-bottom: 12px; }
.quiz-card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
  display: inline-block;
}
.tag-easy { background: #DCFCE7; color: #166534; }
.tag-medium { background: #FEF9C3; color: #854D0E; }
.tag-hard { background: #FEE2E2; color: #991B1B; }
.btn-play {
  width: 100%; background: var(--purple); color: #fff; border: none;
  padding: 12px; border-radius: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  transition: background 0.2s;
}
.btn-play:hover { background: var(--purple-light); }

/* ─── QUIZ PLAYER ─────────────────────────── */
.quiz-player { max-width: 700px; margin: 0 auto; padding: 24px 0; }
.quiz-progress { background: var(--border); border-radius: 8px; height: 8px; margin-bottom: 28px; overflow: hidden; }
.quiz-progress-bar {
  background: linear-gradient(90deg, var(--purple), var(--blue));
  height: 100%; border-radius: 8px; transition: width 0.4s ease;
}
.quiz-question-card {
  background: var(--card); border-radius: 20px; padding: 32px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06); margin-bottom: 20px;
}
.quiz-question-card h2 { text-align: center; font-size: clamp(18px, 3vw, 22px); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option {
  color: #fff; border: none; padding: 18px 16px; border-radius: 12px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  text-align: left; display: flex; align-items: center; gap: 10px;
  transition: all 0.2s; min-height: 60px;
}
.quiz-option-a { background: var(--red); }
.quiz-option-b { background: var(--blue); }
.quiz-option-c { background: var(--yellow); }
.quiz-option-d { background: var(--green); }
.quiz-option.correct { background: var(--green) !important; opacity: 1 !important; }
.quiz-option.wrong { background: #991B1B !important; opacity: 0.8 !important; }
.quiz-option.dimmed { opacity: 0.4; }

.quiz-hint-btn {
  display: block; margin: 16px auto 0; background: rgba(255,166,2,0.15);
  color: var(--amber); border: none; padding: 8px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
}
.quiz-hint {
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px;
  padding: 10px 16px; margin-top: 16px; text-align: center; font-size: 14px; color: #92400E;
}
.quiz-explanation {
  border-radius: 12px; padding: 14px 18px; margin-top: 16px; font-size: 14px; line-height: 1.5;
}
.quiz-explanation.correct-bg { background: #DCFCE7; }
.quiz-explanation.wrong-bg { background: #FEE2E2; }
.quiz-next {
  display: block; width: 100%; margin-top: 16px; background: var(--purple);
  color: #fff; border: none; padding: 16px; border-radius: 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 17px;
}
.quiz-tf-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-tf-btn {
  color: #fff; border: none; padding: 24px; border-radius: 16px;
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
  min-height: 80px; transition: all 0.2s;
}
.quiz-type-input {
  display: flex; gap: 8px; max-width: 400px; margin: 0 auto;
}
.quiz-type-input input {
  flex: 1; padding: 14px 18px; border-radius: 12px; border: 2px solid var(--border);
  font-size: 16px; font-family: var(--font-body); outline: none;
}
.quiz-type-input input:focus { border-color: var(--purple); }
.quiz-type-input button {
  background: var(--purple); color: #fff; border: none;
  padding: 14px 24px; border-radius: 12px; font-weight: 700; font-size: 15px;
}

@media (max-width: 600px) {
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-tf-options { grid-template-columns: 1fr; }
}

/* ─── RESULTS ─────────────────────────────── */
.results-card {
  background: var(--card); border-radius: 24px; padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); text-align: center;
  max-width: 500px; margin: 40px auto;
}
.results-ring { position: relative; width: 140px; height: 140px; margin: 20px auto; }
.results-ring svg { transform: rotate(-90deg); }
.results-ring .score-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.results-ring .score-num { font-family: var(--font-head); font-weight: 900; font-size: 32px; }
.results-share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.results-share button {
  background: rgba(70,23,143,0.1); border: none; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--purple);
}
.results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ─── STATS BAR ───────────────────────────── */
.stats-bar {
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  border-radius: 24px; padding: 36px 24px; margin: 20px 0;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px; text-align: center;
}
.stats-grid .number { font-family: var(--font-head); font-weight: 900; font-size: clamp(28px, 4vw, 40px); color: var(--yellow); }
.stats-grid .label { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 600; }

/* ─── HOW IT WORKS ────────────────────────── */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px;
}
.step-card {
  background: var(--card); border-radius: 20px; padding: 28px;
  text-align: center; box-shadow: var(--shadow);
}
.step-number {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(70,23,143,0.1); display: flex; align-items: center;
  justify-content: center; margin: 0 auto 16px;
  font-family: var(--font-head); font-weight: 800; font-size: 24px; color: var(--purple);
}
.step-card .icon { font-size: 32px; margin-bottom: 8px; }
.step-card h3 { font-size: 16px; margin-bottom: 6px; }
.step-card p { color: var(--text-light); font-size: 14px; }

/* ─── NEWSLETTER ──────────────────────────── */
.newsletter { text-align: center; }
.newsletter-form {
  display: flex; gap: 8px; max-width: 420px; margin: 20px auto 0;
  flex-wrap: wrap; justify-content: center;
}
.newsletter-form input {
  flex: 1; min-width: 200px; padding: 12px 16px; border-radius: 12px;
  border: 2px solid var(--border); font-size: 15px; font-family: var(--font-body); outline: none;
}
.newsletter-form input:focus { border-color: var(--purple); }
.newsletter-form button {
  background: var(--green); color: #fff; border: none;
  padding: 12px 24px; border-radius: 12px; font-weight: 700; font-size: 15px;
}

/* ─── FOOTER ──────────────────────────────── */
.site-footer {
  background: var(--purple); color: rgba(255,255,255,0.85);
  padding: 40px 20px 20px; margin-top: 60px;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px; max-width: 1200px; margin: 0 auto;
}
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer-col a { display: block; padding: 4px 0; font-size: 14px; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 40px; height: 40px; background: rgba(255,255,255,0.15);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background 0.2s;
}
.footer-social a:hover { background: rgba(255,255,255,0.3); }
.footer-bottom {
  text-align: center; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15); font-size: 13px;
}

/* ─── BLOG / SINGLE POST ──────────────────── */
.post-content { max-width: 750px; margin: 0 auto; padding: 32px 0; }
.post-content h1 { margin-bottom: 12px; }
.post-meta { color: var(--text-light); font-size: 14px; margin-bottom: 24px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-body { font-size: 17px; line-height: 1.8; color: #2D2D2D; }
.post-body h2 { margin: 32px 0 12px; font-size: 24px; }
.post-body h3 { margin: 24px 0 8px; font-size: 20px; }
.post-body blockquote {
  border-left: 4px solid var(--purple); background: #F3F0FF;
  padding: 16px 20px; margin: 20px 0; border-radius: 0 8px 8px 0;
  font-style: italic;
}
.post-body img { border-radius: 12px; margin: 20px 0; }
.post-body a { color: var(--purple); font-weight: 600; }
.post-body a:hover { text-decoration: underline; }

/* ─── BREADCRUMBS ─────────────────────────── */
.breadcrumbs {
  padding: 16px 0; font-size: 13px; color: var(--text-light);
}
.breadcrumbs a { color: var(--purple); font-weight: 600; }
.breadcrumbs span { margin: 0 6px; }

/* ─── AD SLOTS ────────────────────────────── */
.ad-slot {
  background: #F3F0FF; border: 2px dashed var(--border);
  border-radius: 12px; padding: 20px; text-align: center;
  color: var(--text-light); font-size: 13px; margin: 20px 0;
}
.ad-slot-leaderboard { min-height: 90px; }
.ad-slot-rectangle { min-height: 250px; }
.ad-slot-banner { min-height: 60px; }

/* ─── 404 PAGE ────────────────────────────── */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 .emoji { font-size: 80px; margin-bottom: 20px; }
.page-404 h1 { margin-bottom: 8px; }
.page-404 p { color: var(--text-light); margin-bottom: 24px; }

/* ─── COOKIE BANNER ───────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--card); padding: 16px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner p { font-size: 14px; color: var(--text-light); margin: 0; }
.cookie-banner a { color: var(--purple); font-weight: 600; }
.cookie-accept {
  background: var(--green); color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-weight: 700; font-size: 14px;
}

/* ─── SEARCH ──────────────────────────────── */
.search-form {
  display: flex; gap: 8px; max-width: 500px; margin: 0 auto;
}
.search-form input {
  flex: 1; padding: 12px 16px; border-radius: 12px;
  border: 2px solid var(--border); font-size: 15px;
  font-family: var(--font-body); outline: none;
}
.search-form input:focus { border-color: var(--purple); }
.search-form button {
  background: var(--purple); color: #fff; border: none;
  padding: 12px 20px; border-radius: 12px; font-weight: 700;
}

/* ─── UTILITIES ───────────────────────────── */
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header a { color: var(--purple); font-weight: 700; font-size: 14px; }
