/*
Theme Name: CGPA King PRO Theme
Theme URI: https://cgpaking.com
Author: CGPA King Team
Author URI: https://cgpaking.com
Description: Official CGPA to Percentage & Academic Grade Point Calculator WordPress Theme.
Version: 1.0.0
Text Domain: cgpa-king-wp-theme
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   CGPA KING - Core CSS Design System & Obsidian Glassmorphic Framework
   Theme: Crimson Red & Dark Obsidian Glass (Default) + Bright Light Theme Toggle
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-red: #e50914;
  --primary-red-hover: #ff2b43;
  --primary-red-glow: rgba(229, 9, 20, 0.35);
  --primary-red-alpha: rgba(229, 9, 20, 0.12);
  
  --bg-obsidian: #08080a;
  --bg-obsidian-light: #101014;
  
  --card-bg: rgba(18, 18, 26, 0.75);
  --card-bg-solid: #12121a;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(229, 9, 20, 0.4);
  
  --text-main: #f0f0f8;
  --text-secondary: #a0a0b8;
  --text-muted: #6c6c84;
  
  --success-green: #10b981;
  --warning-amber: #f59e0b;
  --info-blue: #3b82f6;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-red-glow: 0 0 25px rgba(229, 9, 20, 0.4);
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light / Bright Theme Tokens Override */
[data-theme="light"] {
  --bg-obsidian: #f4f6fa;
  --bg-obsidian-light: #ffffff;
  
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-solid: #ffffff;
  --card-border: rgba(0, 0, 0, 0.09);
  --card-border-hover: rgba(229, 9, 20, 0.4);
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .select-control,
[data-theme="light"] .input-control {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .select-control option {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .scale-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .scale-btn.active {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: #ffffff;
}

[data-theme="light"] .history-table th {
  background: #f8fafc;
  color: #475569;
}

[data-theme="light"] .history-table td {
  border-bottom-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .toc-sidebar {
  background: #ffffff;
}

[data-theme="light"] .article-body h2,
[data-theme="light"] .article-body h3,
[data-theme="light"] .toc-title,
[data-theme="light"] .card-title,
[data-theme="light"] .hero-title {
  color: #0f172a;
}

[data-theme="light"] .hero-title span {
  background: linear-gradient(135deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title .highlight-red {
  color: var(--primary-red);
  -webkit-text-fill-color: var(--primary-red);
}

[data-theme="light"] .faq-question {
  color: #0f172a;
}

[data-theme="light"] .app-footer {
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="light"] .footer-title,
[data-theme="light"] .footer-brand .brand-title {
  color: #ffffff;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Particle Canvas Overlay */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Layout Wrappers */
.app-header, .app-main, .app-footer {
  position: relative;
  z-index: 10;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.app-header {
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition-smooth);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.brand-icon-box {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-red), #b20610);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-red-glow);
}

.brand-title span {
  color: var(--primary-red);
}

.brand-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: var(--primary-red-alpha);
  color: var(--primary-red);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 4px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  min-width: 240px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  list-style: none;
  z-index: 1100;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(4px);
}

.dropdown-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.dropdown-item a:hover {
  background: var(--primary-red-alpha);
  color: var(--text-main);
}

.dropdown-item a i {
  color: var(--primary-red);
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.nav-cta {
  background: linear-gradient(135deg, var(--primary-red), #b20610);
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
  font-weight: 700;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

/* Header Right Actions Container */
.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--primary-red-alpha);
  color: var(--primary-red);
  border-color: var(--primary-red);
}

/* Mobile Nav Toggle Icon - STRICTLY HIDDEN ON DESKTOP */
.mobile-nav-toggle {
  display: none !important;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

/* Glassmorphic Card Components */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  margin-bottom: 32px;
}

.glass-card:hover {
  border-color: rgba(229, 9, 20, 0.3);
}

.glass-card-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title i {
  color: var(--primary-red);
}

/* Hero Section */
.hero-section {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-red-alpha);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 30px;
  color: var(--primary-red);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

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

.hero-title .highlight-red {
  color: var(--primary-red);
  -webkit-text-fill-color: var(--primary-red);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 32px;
}

/* Calculator Form Controls */
.calculator-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scale-toggle-group {
  display: flex;
  gap: 10px;
}

.scale-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.scale-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.scale-btn.active {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: #ffffff;
  box-shadow: var(--shadow-red-glow);
}

.select-control, .input-control {
  width: 100%;
  padding: 14px 18px;
  background: rgba(10, 10, 14, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: var(--transition-smooth);
  outline: none;
}

.select-control:focus, .input-control:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px var(--primary-red-alpha);
}

.select-control option {
  background: var(--card-bg-solid);
  color: var(--text-main);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Action Buttons */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-red), #b20610);
  color: #ffffff;
  box-shadow: var(--shadow-red-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--primary-red-hover), #c90812);
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.6);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(229, 9, 20, 0.4);
}

/* Result Box Component */
.result-box {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.08), rgba(18, 18, 26, 0.9));
  border: 1px solid var(--primary-red-alpha);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  margin-top: 24px;
  display: none;
  animation: fadeIn 0.4s ease;
}

.result-val {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary-red);
  line-height: 1.1;
  margin: 12px 0 6px;
  text-shadow: 0 0 20px var(--primary-red-glow);
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.formula-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* History Table Component */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.history-table th {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--card-border);
}

.history-table td {
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-tag {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.badge-red {
  background: var(--primary-red-alpha);
  color: var(--primary-red);
}

.btn-icon-del {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.btn-icon-del:hover {
  transform: scale(1.2);
}

/* Subject-Wise Grade Calculator Table */
.subject-row-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 40px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

/* Grid Tools Row */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-smooth);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tool-card:hover {
  border-color: var(--primary-red);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-red-alpha);
  color: var(--primary-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.tool-info h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.tool-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* How It Works Feature Badges */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.feature-badge-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.feature-badge-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red), #b20610);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-red-glow);
}

.feature-badge-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-badge-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* SEO Article Content & Sidebar TOC */
.seo-article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 100px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition-smooth);
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.toc-link:hover, .toc-link.active {
  color: var(--primary-red);
  background: var(--primary-red-alpha);
  font-weight: 600;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 24px 0 12px;
}

.article-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.article-body ul, .article-body ol {
  color: var(--text-secondary);
  margin: 0 0 20px 24px;
}

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

/* FAQ Accordion Component */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-question {
  padding: 20px 24px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-question i {
  color: var(--primary-red);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary-red);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
}

/* Footer */
.app-footer {
  background: #050507;
  border-top: 1px solid var(--card-border);
  padding: 60px 0 30px;
  margin-top: 80px;
}

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

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 16px;
  max-width: 320px;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
}

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

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--primary-red);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Mobile & Desktop Responsive Breakpoints & Mobile Nav Alignments */
@media (min-width: 769px) {
  .mobile-nav-toggle {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .seo-article-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .subject-row-grid {
    grid-template-columns: 1fr 1fr 1fr 30px;
    gap: 8px;
  }
  
  /* Mobile Navigation Controls */
  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
  }

  .mobile-nav-toggle:hover {
    background: var(--primary-red-alpha);
    color: var(--primary-red);
    border-color: var(--primary-red);
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg-solid);
    border-bottom: 1px solid var(--card-border);
    padding: 20px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1200;
  }

  .nav-menu.open {
    display: flex !important;
    animation: fadeIn 0.3s ease;
  }

  .nav-dropdown .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: none;
    border: none;
    margin-top: 8px;
    padding-left: 12px;
  }

  .nav-cta {
    text-align: center;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ==========================================================================
   Interactive Chart & Floating Score Badge Component
   ========================================================================== */
.chart-box-card {
  margin-top: 32px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.chart-canvas-wrapper {
  position: relative;
  max-width: 260px;
  height: 260px;
  margin: 20px auto;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.chart-legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-bg-light);
  border: 1px solid var(--card-border);
}

.chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.floating-score-badge {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
  background: var(--card-bg);
  border: 1px solid var(--primary-red);
  padding: 10px 18px;
  border-radius: 30px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(229, 9, 20, 0.35);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.floating-score-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(229, 9, 20, 0.5);
}

