/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rust: #C0392B;
  --rust-dark: #A93226;
  --rust-light: #E74C3C;
  --cream-bg: #F0EBE1;
  --card-bg: #E8E0D0;
  --white: #FFFFFF;
  --text-dark: #2C2C2C;
  --text-mid: #555555;
  --text-light: #777777;
  --border: #D5CCB8;
  --gold: #F39C12;
  --blue-link: #2980B9;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-main);
  background: #EDEDED;
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ===== NAVBAR ===== */
.navbar {
  background: var(--cream-bg);
  border-bottom: 2px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--rust);
}

.navbar-brand .brand-icon {
  font-size: 1.5rem;
}

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

.nav-links > li {
  position: relative;
}

.nav-links > li > a,
.nav-links > li > button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.nav-links > li > a:hover,
.nav-links > li > button:hover {
  color: var(--rust);
}

.nav-links > li.active > a,
.nav-home > a {
  background: var(--rust) !important;
  color: white !important;
}

.nav-home a {
  background: var(--rust);
  color: white;
  padding: 8px 20px;
  border-radius: 24px;
}

/* Dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.2rem 1.5rem;
  min-width: 640px;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 16px;
  z-index: 999;
}

.dropdown-trigger:hover + .dropdown-menu,
.dropdown-menu:hover {
  display: grid;
}

.dropdown-trigger:focus + .dropdown-menu,
.dropdown-trigger:active + .dropdown-menu {
  display: grid;
}

.dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--rust);
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--cream-bg);
  color: var(--rust-dark);
}

.nav-extras {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav-extras a { color: var(--text-dark); display: flex; align-items: center; gap: 5px; }
.nav-extras a:hover { color: var(--rust); }
.lang-tag { font-weight: 700; color: var(--text-dark); }

/* ===== PAGE HEADER ===== */
.page-header {
  background: #EDEDED;
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--rust);
  margin-bottom: 0.75rem;
}

.page-header .divider {
  width: 80%;
  max-width: 700px;
  height: 1px;
  background: var(--border);
  margin: 0.75rem auto 1rem;
}

.page-header .subtitle {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 700px;
  margin: 0 auto;
}

.page-header .subtitle a {
  color: var(--blue-link);
  font-weight: 700;
  text-decoration: underline;
}

/* ===== TOOL CARD ===== */
.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 820px;
  margin: 1.5rem auto;
  box-shadow: var(--shadow);
}

.tool-card h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.8rem;
}

/* Form rows */
.course-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 0.5rem;
}

.course-header label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  padding-left: 4px;
}

.course-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.course-row input,
.course-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  font-size: 0.93rem;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
}

.course-row input:focus,
.course-row select:focus {
  border-color: var(--rust);
}

/* Buttons */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  transition: all 0.2s;
}

.btn-gray {
  background: #9E9E9E;
  color: white;
}
.btn-gray:hover { background: #888; }

.btn-rust {
  background: var(--rust);
  color: white;
}
.btn-rust:hover { background: var(--rust-dark); }

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

/* Result box */
.result-box {
  background: var(--rust);
  color: white;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  text-align: center;
  margin-top: 1.5rem;
  display: none;
}

.result-box .gpa-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.result-box .gpa-label {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-top: 4px;
}

.result-box .gpa-classification {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 8px;
  opacity: 0.85;
}

/* ===== CONTENT AREA ===== */
.content-area {
  background: #EDEDED;
  padding: 1rem 1rem 3rem;
}

.content-section {
  max-width: 820px;
  margin: 2rem auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow);
}

.content-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.2rem;
  text-align: center;
}

.content-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 1.2rem 0 0.4rem;
}

.content-section p {
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 0.8rem;
  font-size: 0.97rem;
}

.content-section ul {
  padding-left: 1.5rem;
  color: var(--text-mid);
  font-size: 0.97rem;
  line-height: 1.8;
}

.formula-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.grade-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.grade-table th {
  background: var(--rust);
  color: white;
  padding: 10px 14px;
  text-align: left;
}

.grade-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}

.grade-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.5);
}

/* Use Cases Grid */
.use-cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.use-case-card {
  background: white;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  border-left: 4px solid var(--rust);
}

.use-case-card h4 {
  font-weight: 700;
  font-size: 0.97rem;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.use-case-card p {
  font-size: 0.88rem;
  margin: 0;
  color: var(--text-mid);
}

/* Steps */
.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.steps-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  background: var(--rust);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-question {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
  font-size: 0.97rem;
}

.faq-question:hover { color: var(--rust); }

.faq-answer {
  color: var(--text-mid);
  font-size: 0.93rem;
  margin-top: 0.6rem;
  display: none;
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-arrow { transition: transform 0.2s; font-size: 0.8rem; }

/* ===== FOOTER ===== */
.footer {
  background: var(--card-bg);
  border-top: 2px solid var(--border);
  padding: 2.5rem 2rem 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  color: var(--rust);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.footer-brand p {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 6px;
}

.footer-col ul li a {
  color: var(--text-light);
  font-size: 0.87rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--rust); }

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links, .nav-extras { display: none; }
  .mobile-menu-btn { display: flex; }
  .page-header h1 { font-size: 1.6rem; }
  .tool-card { padding: 1.5rem 1rem; margin: 1rem; }
  .course-header, .course-row { grid-template-columns: 1fr; }
  .use-cases-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .dropdown-menu { min-width: 300px; grid-template-columns: 1fr 1fr; left: 0; transform: none; }
  .content-section { margin: 1rem; padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}
