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

:root {
  --bg-base: #03050a;
  --bg-card: rgba(18, 22, 33, 0.45);
  --bg-card-hover: rgba(28, 34, 51, 0.65);
  --bg-input: rgba(8, 10, 15, 0.6);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-active: #4facfe;
  
  --text-primary: #ffffff;
  --text-secondary: #9aa0ac;
  --text-muted: #5f6574;
  
  --accent-blue: #4facfe;
  --accent-blue-hover: #00f2fe;
  --accent-glow: 0 0 32px rgba(79, 172, 254, 0.4);
  --accent-chart: #00f2fe;
  
  --gradient-primary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-surface: linear-gradient(180deg, rgba(30, 36, 52, 0.6) 0%, rgba(15, 18, 26, 0.6) 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 172, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 20px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.site-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

/* ===== HEADER ===== */
.navbar {
  padding: 16px 0;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 13, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}
.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
}
.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.01em;
}
.logo-text p {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links center { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 8px;
  position: relative;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--accent-blue);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -2px 10px rgba(32,138,240,0.6);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.search-pill {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-pill input {
  background: none;
  border: none;
  color: white;
  outline: none;
  font-size: 0.9rem;
  width: 140px;
}
.search-pill input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 0.9rem; }

.profile-btn {
  background: rgba(255,255,255,0.03);
  padding: 4px 12px 4px 4px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.profile-btn img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-color);
}

.live-data {
  position: absolute;
  right: 32px;
  top: 96px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #cfd6e4;
  background: rgba(255,255,255,0.05);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.05);
}
.live-data .dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.6);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.main-card {
  display: flex;
  flex-direction: column;
}

/* Left Content of Main Card */
.mc-header {
  margin-bottom: 32px;
}
.mc-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.mc-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.5;
}

.mc-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  flex: 1;
}

/* Pseudo Chart Area */
.chart-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 30px;
  padding-left: 10px;
}
.y-axis {
  position: absolute;
  left: -50px;
  top: 0;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.x-axis {
  position: absolute;
  bottom: -25px;
  left: 10px;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.grid-lines {
  position: absolute;
  top: 0; left: 10px; right: 0; bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.grid-lines div {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.03);
}

.chart-lines {
  position: absolute;
  top: 0; left: 10px; right: 0; bottom: 30px;
  background: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0,90 Q40,80 100,20" fill="none" stroke="%23208af0" stroke-width="2"/><path d="M0,90 Q40,60 100,50" fill="none" stroke="rgba(32,138,240,0.4)" stroke-width="2" stroke-dasharray="2,2"/></svg>') no-repeat;
  background-size: 100% 100%;
  background-position: bottom;
}
.chart-fill {
  position: absolute;
  top: 0; left: 10px; right: 0; bottom: 30px;
  background: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0,90 Q40,80 100,20 L100,100 L0,100 Z" fill="url(%23g)"/><defs><linearGradient id="g" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="rgba(32,138,240,0.3)"/><stop offset="100%" stop-color="rgba(32,138,240,0)"/></linearGradient></defs></svg>') no-repeat;
  background-size: 100% 100%;
}
.chart-tooltip {
  position: absolute;
  top: 30%; left: 50%;
  background: rgba(20, 24, 33, 0.9);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  pointer-events: none;
}
.chart-tooltip span { display: block; }
.chart-tooltip .val { color: #fff; font-family: 'JetBrains Mono', monospace; font-weight: 700; display: flex; align-items: center; gap: 6px;}
.chart-tooltip .val::before { content: ''; width: 6px; height: 6px; background: var(--accent-blue); border-radius: 50%; display: inline-block; }

/* Right Form Area */
.form-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.form-group input[type="text"], .form-group input[type="number"], .form-group select {
  background: var(--bg-input);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(32, 138, 240, 0.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.slider-group label { font-size: 0.8rem; color: var(--text-secondary); }
.slider-wrap {
  position: relative;
  height: 6px;
  background: var(--border-color);
  border-radius: 100px;
}
.slider-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 60%;
  background: var(--accent-blue);
  border-radius: 100px;
  box-shadow: var(--accent-glow);
}
.slider-thumb {
  position: absolute;
  top: 50%; left: 60%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  cursor: pointer;
}
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted); margin-top: 4px;
}

.calc-btn {
  background: linear-gradient(135deg, #208af0, #1a6ac9);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--accent-glow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}
.calc-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}
.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(32, 138, 240, 0.6);
}
.calc-btn:hover::after {
  left: 120%;
}

.results-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.res-item label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
  line-height: 1.3;
}
.res-item .val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.res-item:first-child .val {
  color: var(--text-primary);
}

/* Custom Slider Styling */
.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 100px;
  outline: none;
  margin: 12px 0;
}
.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(32, 138, 240, 0.4);
  transition: transform 0.2s ease;
}
.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.custom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(32, 138, 240, 0.4);
}

/* Side Grid */
.side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.side-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.side-card:hover {
  border-color: rgba(32, 138, 240, 0.5);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(32, 138, 240, 0.15);
}
.sc-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}
.sc-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: auto;
}

/* Card variants */
.card-chart .sc-vis {
  margin: 16px 0;
  height: 60px;
  background: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0,80 Q25,30 50,60 T100,20 L100,100 L0,100 Z" fill="rgba(32,138,240,0.15)"/><path d="M0,80 Q25,30 50,60 T100,20" fill="none" stroke="%23208af0" stroke-width="2"/></svg>') no-repeat;
  background-size: 100% 100%;
}
.card-icon .sc-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  color: var(--accent-blue);
}
.card-link {
  font-size: 0.85rem;
  color: var(--accent-blue);
  margin-top: 12px;
  display: inline-block;
  font-weight: 500;
}

/* Tool page styling overrides */
.calc-page { padding: 20px 0 80px; }
.calc-header { margin-bottom: 8px; }
.calc-header h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff, #c0c8d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.calc-header p { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; max-width: 640px; }
.calc-widget {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 30px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 12px 0;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .current { color: var(--text-secondary); }

/* ===== CALC FORM ===== */
.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}
.calc-form .form-group input[type="date"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}
.calc-form .form-group input[type="date"]:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(32, 138, 240, 0.1);
}

/* ===== CALC ACTIONS ===== */
.calc-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.calc-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calc-btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(32, 138, 240, 0.06);
}

/* ===== CALC RESULT ===== */
.calc-result {
  margin-top: 32px;
  padding: 32px;
  background: rgba(32, 138, 240, 0.04);
  border: 1px solid rgba(32, 138, 240, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  padding: 0 32px;
}
.calc-result.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 400px;
  padding: 32px;
}
.result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
}
.result-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
  text-shadow: 0 0 24px rgba(32, 138, 240, 0.3);
}
.result-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.result-details span {
  background: rgba(32, 138, 240, 0.08);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid rgba(32, 138, 240, 0.1);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  margin-top: 48px;
}
.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.content-section p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== FORMULA BOX ===== */
.formula-box {
  margin-top: 20px;
  padding: 20px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: inline-block;
}
.formula-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
}

/* ===== EXAMPLE BOX ===== */
.example-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-top: 16px;
}
.example-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.example-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== FAQ SECTION ===== */
.faq-section {
  margin-top: 48px;
}
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s;
}
.faq-item:hover {
  border-color: rgba(32, 138, 240, 0.3);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--accent-blue); }
.faq-question .icon {
  font-size: 1.4rem;
  color: var(--accent-blue);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item.open .faq-question .icon {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== RELATED SECTION ===== */
.related-section {
  margin-top: 48px;
}
.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.related-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.related-link:hover {
  border-color: rgba(32, 138, 240, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  color: var(--accent-blue);
}
.related-link .r-icon { font-size: 1.3rem; }

/* ===== TOOLS GRID (category pages) ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.tool-card:hover {
  border-color: rgba(32, 138, 240, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(32, 138, 240, 0.12);
}
.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tool-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.tool-card .arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: all 0.3s;
}
.tool-card:hover .arrow {
  color: var(--accent-blue);
  transform: translateX(4px);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: 100px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.theme-toggle.light::after {
  transform: translateX(20px);
  background: #f39c12;
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== FOOTER ===== */
footer {
  margin-top: 80px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--border-color);
  background: rgba(6, 8, 13, 0.5);
  backdrop-filter: blur(12px);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.footer-col h4 {
  font-size: 0.85rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--accent-blue); }
.footer-socials { display: flex; gap: 12px; margin-top: 12px; }
.footer-socials span {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  display: inline-block;
  transition: all 0.3s;
  cursor: pointer;
}
.footer-socials span:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

/* ===== SMOOTH SCROLL & SELECTION ===== */
html { scroll-behavior: smooth; }
::selection {
  background: rgba(32, 138, 240, 0.3);
  color: #fff;
}

/* ===== KEYFRAMES ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.live-data .dot {
  animation: pulse 2s ease-in-out infinite;
}



/* ===== HERO SECTION ===== */
.hero-section {
  padding: 60px 0 40px;
  background: radial-gradient(circle at 50% 100%, rgba(32, 138, 240, 0.12) 0%, transparent 50%);
  text-align: center;
  overflow: hidden;
  position: relative;
}
.hero-content {
  max-width: 800px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(32, 138, 240, 0.1);
  border: 1px solid rgba(32, 138, 240, 0.2);
  color: var(--accent-blue);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  color: #fff;
}
.text-gradient {
  background: linear-gradient(135deg, var(--accent-blue), #81c2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

/* ===== HERO SEARCH ===== */
.hero-search-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}
.hero-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 8px 8px 8px 24px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-search-box:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(32, 138, 240, 0.3);
}
.hero-search-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-right: 16px;
}
.hero-search-box input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1.15rem;
  color: #fff;
  outline: none;
  padding: 12px 0;
}
.hero-search-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.hero-search-btn:hover {
  background: var(--accent-blue-hover);
  transform: scale(1.02);
}
.search-suggestions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.search-suggestions a {
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 100px;
  transition: all 0.2s;
}
.search-suggestions a:hover {
  background: rgba(32, 138, 240, 0.15);
  color: var(--accent-blue);
}

/* ===== QUICK ACCESS & TILES ===== */
.quick-access-section {
  padding: 60px 0;
}
.section-header {
  margin-bottom: 32px;
}
.section-header h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}
.category-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-tile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.cat-tile:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.ct-icon { font-size: 2.25rem; }
.ct-text h4 { font-size: 1.1rem; color: #fff; margin-bottom: 4px; }
.ct-text p { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ===== FEATURED SECTIONS ===== */
.featured-sections {
  padding: 40px 0 100px;
}
.featured-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.featured-col {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--border-color);
}
.f-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.f-icon { font-size: 1.5rem; }
.f-header h4 { font-size: 1.25rem; font-weight: 700; color: #fff; }
.f-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.f-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 8px 0;
  transition: all 0.2s;
}
.f-links a:hover {
  color: var(--accent-blue);
  padding-left: 4px;
}
.f-links a span {
  font-size: 0.65rem;
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

body.light-mode .hero-badge { background: rgba(32, 138, 240, 0.1); }
body.light-mode .hero-title { color: #1a1d26; }
body.light-mode .hero-search-box { background: #fff; border-color: rgba(0, 0, 0, 0.1); color: #1a1d26; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1); }
body.light-mode .hero-search-box input { color: #1a1d26; }
body.light-mode .cat-tile { background: #fff; border-color: rgba(0,0,0,0.06); }
body.light-mode .cat-tile:hover { background: #fff; }
body.light-mode .featured-col { background: #fff; }
body.light-mode .f-header h4 { color: #1a1d26; }

/* ===== LIGHT MODE ===== */
body.light-mode {
  --bg-base: #f4f6fa;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(255, 255, 255, 0.6);
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #1a1d26;
  --text-secondary: #5a5f6d;
  --text-muted: #9098a8;
  --accent-glow: 0 0 24px rgba(32, 138, 240, 0.25);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(32, 138, 240, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(32, 138, 240, 0.03) 0%, transparent 40%);
}
body.light-mode .navbar {
  background: rgba(244, 246, 250, 0.85);
}
body.light-mode .logo-text h1 { color: #1a1d26; }
body.light-mode .chart-tooltip { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.1); }
body.light-mode .chart-tooltip .val { color: #1a1d26; }
body.light-mode .calc-header h1 {
  background: linear-gradient(135deg, #1a1d26, #3a4050);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.light-mode .calc-result {
  background: rgba(32, 138, 240, 0.06);
  border-color: rgba(32, 138, 240, 0.2);
}
body.light-mode .result-value { 
  color: var(--accent-blue);
  text-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}
body.light-mode .result-label { color: #3a4050; font-weight: 700; }
body.light-mode .result-details span { 
  background: rgba(0, 0, 0, 0.03); 
  color: #1a1d26;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .form-group label { color: #3a4050; font-weight: 600; }
body.light-mode .form-group input, 
body.light-mode .form-group select { 
  color: #1a1d26; 
  background: #fff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
body.light-mode footer {
  background: rgba(244, 246, 250, 0.7);
}
body.light-mode ::selection {
  background: rgba(32, 138, 240, 0.2);
  color: #1a1d26;
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE DESIGN (SYSTEM V3)
   ============================================================ */

/* Small Laptops & Large Tablets */
@media (max-width: 1240px) {
  .site-wrapper { padding: 0 24px; }
  .category-tiles { grid-template-columns: repeat(4, 1fr); }
  .featured-row { gap: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Standard Tablets (Portrait) */
@media (max-width: 1024px) {
  .hero-title { font-size: 2.8rem; }
  .category-tiles { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .featured-row { grid-template-columns: repeat(2, 1fr); }
  
  /* Mobile Navigation Menu */
  .nav-links { 
    display: none; 
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 16px;
    left: 16px;
    background: #0f121a;
    backdrop-filter: blur(40px);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    z-index: 1000;
    gap: 20px;
    text-align: center;
  }
  .nav-links.active { display: flex; animation: fadeInUp 0.4s ease forwards; }
  .nav-links a { font-size: 1.1rem; padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .nav-links a:last-child { border-bottom: none; }
  
  .hamburger { display: flex; }
  .header-actions .search-pill { display: none; } /* Hide header search on mobile */
  
  .side-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Large Phones & Small Tablets */
@media (max-width: 768px) {
  body { padding-bottom: 40px; }
  .site-wrapper { padding: 0 16px; }
  
  .navbar-inner { height: 60px; }
  .logo-container img { height: 36px !important; }
  .logo-text h1 { font-size: 1.1rem; }
  .logo-text p { display: none; }
  
  /* Hero Optimization */
  .hero-section { padding: 40px 0 24px; }
  .hero-title { font-size: 2.1rem; margin-bottom: 10px; letter-spacing: -0.03em; }
  .hero-subtitle { font-size: 0.95rem; margin-bottom: 24px; line-height: 1.4; color: var(--text-secondary); }
  
  /* Search Bar Mobile Layout */
  .hero-search-box { 
    padding: 6px 6px 6px 16px; 
    border-radius: 14px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }
  .hero-search-icon { margin-right: 10px; font-size: 1.1rem; }
  .hero-search-box input { font-size: 0.95rem; padding: 10px 0; }
  .hero-search-btn { padding: 10px 16px; font-size: 0.8rem; border-radius: 10px; }
  
  .search-suggestions { flex-wrap: wrap; gap: 8px; font-size: 0.75rem; justify-content: center; }
  
  /* Dashboard Grid Fix */
  .category-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-tile { padding: 16px 12px; gap: 12px; border-radius: 16px; }
  .ct-icon { font-size: 1.6rem; }
  .ct-text h4 { font-size: 0.9rem; }
  .ct-text p { font-size: 0.7rem; }
  
  .featured-row { grid-template-columns: 1fr; gap: 16px; }
  .featured-col { padding: 24px; border-radius: 20px; }
  
  /* Calculator Page Fixes */
  .calc-header h1 { font-size: 1.6rem; }
  .calc-widget { padding: 20px; margin: 16px 0; }
  .calc-form { grid-template-columns: 1fr; }
  .calc-actions { flex-direction: column; gap: 10px; }
  .calc-btn, .calc-btn-secondary { width: 100%; justify-content: center; padding: 14px; }
  
  .result-value { font-size: 2rem; }
  .result-details { gap: 8px; }
  .result-details span { font-size: 0.75rem; padding: 6px 12px; }
  
  .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .live-data { display: none; }
}

/* Small Phones */
@media (max-width: 400px) {
  .hero-title { font-size: 1.75rem; }
  .category-tiles { grid-template-columns: 1fr; } /* Single column for narrow phones */
  
  .logo-text h1 { font-size: 1rem; }
  .header-actions { gap: 8px; }
  
  .hero-search-box { flex-direction: column; padding: 12px; gap: 10px; height: auto; }
  .hero-search-box input { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); padding-left: 30px; }
  .hero-search-icon { position: absolute; left: 12px; top: 22px; }
  .hero-search-btn { width: 100%; }
}
