/* ==========================================================================
   EduTool Portal - Perfected Grid Layout & Ultra-Premium Design System
   ========================================================================== */

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Dark Mode Palette (Rich Midnight Slate) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #26334d;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(99, 102, 241, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  
  --glass-backdrop: blur(16px);
}

/* Light Mode Palette */
body.light-mode {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(99, 102, 241, 0.45);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.09);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

/* Global Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Background Radial Glow */
body::before {
  content: '';
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 40%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-secondary);
}

/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 20px;
}

body.light-mode .pill-badge {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

/* Header Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
}

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

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 50px 0 35px;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 740px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* PERFECTED 3-COLUMN CARD GRID */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.glass-card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.glass-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  line-height: 1.35;
}

.glass-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 22px;
  flex-grow: 1;
  line-height: 1.55;
}

/* Card Full-Width Action Button */
.glass-card .btn-primary {
  width: 100%;
  margin-top: auto;
}

/* Premium Buttons */
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff !important;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  opacity: 0.96;
}

/* Tool Interface Specific Container */
.tool-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

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

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.98rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* Articles Section */
.article-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 38px;
  margin-bottom: 50px;
  box-shadow: var(--shadow-sm);
}

.article-section h2 {
  font-size: 1.8rem;
  margin-bottom: 18px;
}

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

.article-section p, .article-section ul, .article-section ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.article-section ul, .article-section ol {
  padding-left: 22px;
}

/* Ad Banner Placeholder */
.ad-slot-placeholder {
  width: 100%;
  min-height: 90px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.copyright {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.1rem;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 20px 0;
    gap: 14px;
    box-shadow: var(--shadow-lg);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .article-section, .tool-wrapper {
    padding: 22px;
  }
}


/* ==========================================================================
   AdSense High-Value Content Enhancements (Breadcrumbs, Tables, FAQs, Steps)
   ========================================================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb-separator {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Formula & Code Boxes */
.formula-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0;
  font-family: monospace;
  font-size: 1.05rem;
  color: var(--accent-secondary);
  overflow-x: auto;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.step-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Content Tables */
.content-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.content-table th, .content-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.content-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 1px;
}

.content-table tr:last-child td {
  border-bottom: none;
}

.content-table tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

/* FAQ Accordion */
.faq-container {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-question {
  padding: 18px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent-primary);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 22px 18px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Related Tools Grid */
.related-tools-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.related-tool-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.related-tool-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.related-tool-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.related-tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
