/* FundPilot Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1f293d;
  --bg-card-hover: #28354e;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.25);
  
  --accent-success: #10b981;
  --accent-success-bg: rgba(16, 185, 129, 0.15);
  
  --accent-warning: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  
  --border-color: #374151;
  --border-subtle: rgba(255, 255, 255, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px var(--accent-glow);
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --border-color: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header Navbar */
.navbar {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.85);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--accent-success-bg);
  color: var(--accent-success);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

/* Search Bar Component */
.search-container {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-dim);
  font-size: 1.2rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 1.1rem 1.25rem 1.1rem 3.2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  outline: none;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.search-result-cat {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
}

/* Category Filter Bar */
.categories-section {
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
}

.categories-bar {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.category-chip {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-chip:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
}

.category-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Section Titles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.tools-count-badge {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tool-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.tool-card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.tool-card-action {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-action {
  transform: translateX(4px);
}

/* Calculator Detail View */
.calculator-view {
  padding: 2rem 0 4rem;
  display: none;
}

.calculator-view.active {
  display: block;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.back-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.calc-title-area {
  margin-bottom: 1.5rem;
}

.calc-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.calc-main-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

/* Inputs Form */
.input-group {
  margin-bottom: 1.5rem;
}

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.input-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.input-val-display {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.field-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.field-control:focus {
  border-color: var(--accent-primary);
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 4px;
  outline: none;
  margin-top: 0.5rem;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Calc Results Panel */
.calc-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.results-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.primary-result-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.primary-result-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.primary-result-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1.1;
}

.results-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.breakdown-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.breakdown-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.breakdown-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* Visualization Bar */
.visual-bar-container {
  margin-top: 1rem;
}

.visual-bar {
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  display: flex;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.visual-bar-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.visual-bar-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Educational Content Sections */
.edu-content-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.content-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.block-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.formula-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 1.05rem;
  color: var(--accent-cyan);
  margin: 1rem 0;
  overflow-x: auto;
}

.example-box {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.faq-question {
  width: 100%;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
  text-align: left;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
  color: var(--accent-primary);
}

.faq-item.open .faq-toggle-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: none;
  line-height: 1.6;
}

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

/* 3rd Party 300x250 Ad Banner Placement Styling */
.ad-slot-wrapper {
  margin: 1.75rem 0;
  text-align: center;
  position: relative;
  clear: both;
}

.ad-slot-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.ad-slot-content-300x250 {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.ad-300x250-box {
  width: 300px;
  height: 250px;
  background: var(--bg-card);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
  transition: all 0.25s ease;
}

.ad-300x250-box:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.ad-300x250-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

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

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

.footer-brand {
  max-width: 320px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.owner-info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.owner-info-box p {
  margin-bottom: 0.25rem;
}

.owner-info-box strong {
  color: var(--text-main);
}

.footer-column-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

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

.footer-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.1rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
