/* ----------  THEME TOKENS  ---------- */
:root {
  --clr-bg      : #ffffff;
  --clr-text    : #1e293b;   /* slate-900  */
  --clr-accent  : #2563eb;   /* blue-600   */
  --clr-accent-lt: #3b82f6;   /* blue-500   */
  --clr-muted   : #64748b;   /* slate-500  */
  --clr-card    : #f8fafc;   /* slate-50   */
  --font-main   : 'Inter', sans-serif;
  --space       : 1rem;
}
[data-theme="dark"] {
  --clr-bg      : #0f172a;
  --clr-text    : #f1f5f9;
  --clr-accent  : #3b82f6;
  --clr-accent-lt: #60a5fa;
  --clr-muted   : #94a3b8;
  --clr-card    : #1e293b;
}

/* ----------  BASE  ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  scroll-behavior: smooth;
}
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
a { text-decoration: none; color: inherit; }

/* ----------  UTILITIES  ---------- */
.container { max-width: 1100px; margin-inline: auto; padding: 0 calc(var(--space)*1); }
.section { padding: calc(var(--space)*5) 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.btn {
  display: inline-block;
  padding: calc(var(--space)*0.75) calc(var(--space)*1.75);
  border-radius: 8px;
  background: var(--clr-accent);
  color: #fff;
  font-weight: 600;
  transition: transform 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  background-color: #1d4ed8;
}
.card {
  background: var(--clr-card);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.text-muted { color: var(--clr-muted); }
.accent { color: var(--clr-accent); }

/* ----------  HEADER (TOP MENU)  ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--clr-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  height: 48px;
  width: auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
}

nav ul li {
  display: inline;
}

nav ul li a {
  color: var(--clr-text);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--clr-accent);
}

/* Mobile menu styles */
@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--clr-bg);
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
    font-size: 24px;
    cursor: pointer;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--clr-text);
  }

  .menu-toggle:hover {
    color: var(--clr-accent);
  }

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

/* ----------  QUIZ-SPECIFIC STYLES  ---------- */
#rules-card, #rule-quiz-card, #quiz-card {
  background: var(--clr-card);
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 700px;
  padding: 30px;
  margin-top: 80px; /* Offset for fixed header */
  margin-bottom: 40px;
  margin-left: auto;
  margin-right: auto;
}

/* Remove red border from card-green for regular sentences, keep for incorrect */
#rules-card.card-green, #rule-quiz-card.card-green, #quiz-card.card-green {
  border-left: none;
}
#rules-card .incorrect, #rule-quiz-card .incorrect, #quiz-card .incorrect {
  border-left: 6px solid #e74c3c;
  padding-left: 10px;
}

h1 {
  color: var(--clr-text);
  font-size: 2.2rem;
  margin-bottom: 25px;
  text-align: center;
  font-weight: 700;
}

h2 {
  color: var(--clr-text);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

h3 {
  color: var(--clr-text);
  font-size: 1.3rem;
  margin-top: 1rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

p {
  margin: 15px 0;
  font-size: 1.1rem;
}

strong {
  font-weight: 700;
}

.rule-example {
  margin: 20px 0;
  font-style: italic;
  padding: 15px;
  border-left: none;
  background-color: #f5f7fa;
  border-radius: 8px;
  font-size: 1.05rem;
}

.rule-example strong.incorrect {
  color: #e74c3c;
  font-weight: 700;
}

.rule-example strong.correct {
  color: #27ae60;
  font-weight: 700;
}

.rule-list {
  margin-bottom: 30px;
}

.toggle-btn {
  background: var(--clr-accent);
  color: #fff;
  padding: 12px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
  transition: background 0.3s ease;
  position: relative;
  font-size: 1.1rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-btn::after {
  content: '▼';
  position: absolute;
  right: 18px;
  transition: transform 0.3s ease;
}

.toggle-btn:hover {
  background: #1d4ed8;
}

.toggle-btn.active::after {
  transform: rotate(180deg);
}

.rule-content {
  display: none;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--clr-muted);
}

.rule-content.show {
  display: block;
}

ul {
  list-style-type: disc;
  padding-left: 25px;
  margin: 15px 0;
}

li {
  margin: 10px 0;
  font-size: 1.1rem;
}

.option-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  background: var(--clr-card);
  border: 2px solid var(--clr-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--clr-text);
}

.option-btn:hover:not([disabled]) {
  background: #dfe6ea;
  transform: translateY(-2px);
  border-color: var(--clr-accent);
}

.option-btn.correct {
  background: #d5f5e3;
  border-color: #27ae60;
  color: #27ae60;
}

.option-btn.incorrect {
  background: #fadbd8;
  border-color: #e74c3c;
  color: #e74c3c;
}

#next-btn, #next-btn-main {
  margin-top: 25px;
  padding: 14px 30px;
  background: var(--clr-accent);
  color: #fff;
  border: 2px solid var(--clr-accent);
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  max-width: 220px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#next-btn:hover, #next-btn-main:hover {
  background: #1d4ed8;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#next-btn:disabled, #next-btn-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--clr-muted);
  border-color: var(--clr-muted);
}

#progress {
  margin-top: 10px;
  font-size: 1rem;
  color: var(--clr-muted);
  text-align: center;
  font-weight: 500;
}

/* ----------  CONTACT  ---------- */
.contact-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.contact-form {
  display: grid;
  gap: 1rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--clr-muted);
  background: var(--clr-card);
  color: var(--clr-text);
}
.contact-grid img { width: 100%; border-radius: 16px; }

/* ----------  FOOTER  ---------- */
/* Footer styling is inherited from the main site stylesheet */
