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

:root {
  --primary: #0F4C81;
  --primary-hover: #0a365c;
  --secondary: #1E88E5;
  --secondary-hover: #1565C0;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #F9A825;
  --warning-light: #FFFDE7;
  --danger: #D32F2F;
  --danger-light: #FFEBEE;
  --background: #F8FAFC;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-focus: #1E88E5;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--background);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Header & Navigation */
header {
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative; /* Anchor for absolute mobile nav */
}

/* Mobile Nav Toggle Button */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 150;
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: var(--text);
  border-radius: 1px;
  transition: var(--transition);
}

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

.logo span {
  color: var(--secondary);
}

.logo svg {
  width: 28px;
  height: 28px;
  fill: var(--primary);
}

.logo img {
  display: block;
}

nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.nav-cta {
  background-color: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.nav-cta:hover {
  background-color: var(--primary-hover);
  color: #fff;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0F4C81 0%, #1A5A96 50%, #1E88E5 100%);
  color: #fff;
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  color: #E3F2FD;
  position: relative;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Container & Main Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .layout-grid {
    grid-template-columns: 320px 1fr;
  }
}

/* Sidebar Navigation */
.sidebar {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-light);
}

/* Top Select Dropdown */
.calculator-select-container {
  margin-bottom: 24px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calculator-select-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calculator-select-wrapper {
  position: relative;
  width: 100%;
}

.calculator-select {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.calculator-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.calculator-select-wrapper::after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 1023px) {
  .sidebar {
    display: none;
  }
}

@media (min-width: 1024px) {
  .calculator-select-container {
    display: none;
  }
}


.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.calc-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.calc-menu-item:hover {
  background-color: var(--background);
  color: var(--primary);
}

.calc-menu-item.active {
  background-color: var(--primary);
  color: #fff;
}

.calc-menu-item.active svg {
  fill: #fff;
}

.calc-menu-item svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  transition: var(--transition);
}

.calc-menu-item:hover svg {
  fill: var(--primary);
}

/* Calculator Card & Grid */
.calc-wrapper {
  display: none;
}

.calc-wrapper.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Fields & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.input-container {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--background);
  transition: var(--transition);
}

.input-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.input-prefix, .input-suffix {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background-color: #E2E8F0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
}

.input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  width: 100%;
}

.input-field::placeholder {
  color: var(--text-light);
}

.input-field.auto-filled {
  color: var(--success);
  font-weight: 600;
}

/* Slider Controls */
.slider-control {
  margin-top: 8px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.slider-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.slider-control::-webkit-slider-thumb:hover {
  background: var(--secondary-hover);
  transform: scale(1.1);
}

/* Presets & Chips */
.presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preset-chip {
  background-color: var(--background);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background-color: #E3F2FD;
}

.preset-chip.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Segmented Buttons */
.segment-container {
  display: flex;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.segment-btn.active {
  background-color: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--background);
}

/* Results Display */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.result-card {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.result-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.result-value.success {
  color: var(--success);
}

.result-value.warning {
  color: var(--warning);
}

.result-value.danger {
  color: var(--danger);
}

.result-subtext {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Chart and Breakdown Info */
.results-visuals {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .results-visuals {
    flex-direction: row;
    justify-content: space-around;
  }
}

.canvas-container {
  position: relative;
  width: 140px;
  height: 140px;
}

.chart-legends {
  flex: 1;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.legend-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.legend-color.principal {
  background-color: var(--primary);
}

.legend-color.interest {
  background-color: var(--danger);
}

.legend-value {
  font-weight: 700;
  color: var(--text);
}

.legend-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Alert Insights */
.insight-box {
  background-color: #F0F9FF;
  border-left: 4px solid var(--secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #0369A1;
  margin-bottom: 24px;
}

.insight-box.success {
  background-color: var(--success-light);
  border-left-color: var(--success);
  color: #1B5E20;
}

.insight-box.warning {
  background-color: var(--warning-light);
  border-left-color: var(--warning);
  color: #E65100;
}

/* Amortization Table */
.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.table-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 400px;
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.amort-table th {
  background-color: var(--background);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.amort-table th:first-child, .amort-table td:first-child {
  text-align: left;
}

.amort-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.amort-table tr:hover td {
  background-color: #F1F5F9;
}

.show-more-btn {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--secondary);
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.show-more-btn:hover {
  background-color: var(--background);
  border-color: var(--secondary);
}

/* Actions and Export */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

/* Prepayment Form Specifics */
.prepay-alert {
  background-color: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.prepay-alert-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.prepay-interactive-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.prepay-interactive-row .field {
  flex: 1;
}

.btn-swap {
  background-color: var(--background);
  border: 1px solid var(--border);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
  margin-bottom: 2px;
}

.btn-swap:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background-color: #E3F2FD;
}

.badge-auto {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(46, 125, 50, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.prepay-interactive-message {
  font-size: 0.78rem;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 500;
}

/* Trust Signals Section */
.trust-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.trust-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.trust-icon {
  width: 48px;
  height: 48px;
  background-color: #E3F2FD;
  color: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}

.trust-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.trust-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Ads Optimization Placement */
.ad-container {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ad-label {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-placeholder {
  width: 100%;
  min-height: 90px;
  background-color: #F1F5F9;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Rich Editorial Content */
.editorial-content {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  margin-top: 32px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .editorial-content {
    padding: 56px 48px;
  }
}

.prose h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 32px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--background);
  padding-bottom: 8px;
}

.prose h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 24px;
  margin-bottom: 12px;
}

.prose p {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose ul, .prose ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
  color: var(--text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}

.prose th {
  background-color: var(--background);
  font-weight: 700;
}

.prose tr:nth-child(even) {
  background-color: #F8FAFC;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 40px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background-color: var(--card);
  overflow: hidden;
  transition: var(--transition);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: var(--background);
}

.faq-answer-content {
  padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}

.faq-item.active .faq-answer {
  max-height: 1000px;
}

/* Author Section */
.author-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .author-card {
    flex-direction: row;
    align-items: center;
  }
}

.author-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.author-role {
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.author-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Blog Feed Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.blog-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.blog-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-tag {
  align-self: flex-start;
  background-color: #E3F2FD;
  color: var(--secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.blog-card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Footer Section */
footer {
  background-color: #0B192C;
  color: #D1D5DB;
  padding: 60px 24px 20px;
  border-top: 1px solid #1E293B;
  font-size: 0.9rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--secondary);
}

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

.footer-col a {
  color: #9CA3AF;
}

.footer-col a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid #1E293B;
  text-align: center;
  font-size: 0.8rem;
  color: #6B7280;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-legal-links a {
  color: #6B7280;
}

.footer-legal-links a:hover {
  color: #fff;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text);
}

/* Saved Loans List styling */
.saved-loans-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-loan-item {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.saved-loan-meta {
  flex: 1;
}

.saved-loan-name {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.saved-loan-details {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.saved-loan-emi-wrap {
  text-align: right;
  flex-shrink: 0;
}

.saved-loan-emi {
  font-weight: 800;
  color: var(--success);
  font-size: 1.1rem;
}

.saved-loan-emi-label {
  font-size: 0.65rem;
  color: var(--text-light);
}

.btn-delete-saved {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-saved:hover {
  background-color: var(--danger-light);
}

.btn-delete-saved svg {
  width: 18px;
  height: 18px;
  fill: var(--danger);
}

/* Cookie consent bar */
.cookie-consent-bar {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
}

.cookie-consent-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.cookie-consent-buttons {
  display: flex;
  gap: 12px;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Overrides */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .container {
    padding: 24px 16px;
  }
  .editorial-content {
    padding: 24px 16px;
  }
  .action-buttons {
    grid-template-columns: 1fr;
  }
}

/* Navigation Dropdown Menu Styles */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  z-index: 200;
  min-width: 650px;
  margin-top: 12px;


  animation: fadeIn 0.2s ease;
}

/* Invisible hover bridge to prevent menu from closing when moving mouse from toggle to dropdown */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background-color: transparent;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.nav-dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.nav-dropdown-col h5 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.nav-dropdown-col a {
  color: var(--text) !important;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: block;
}

.nav-dropdown-col a:hover {
  background-color: var(--background);
  transition: var(--transition);
}

@media (max-width: 1023px) {
  .mobile-nav-toggle {
    display: flex;
  }
  
  #main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    gap: 16px;
    align-items: stretch;
    z-index: 140;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  
  .nav-container.nav-open #main-nav {
    display: flex;
  }
  
  /* Hamburger Animation when open */
  .nav-container.nav-open .mobile-nav-toggle .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav-container.nav-open .mobile-nav-toggle .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-container.nav-open .mobile-nav-toggle .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-dropdown {
    display: block;
    width: 100%;
  }
  .nav-dropdown-toggle {
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
  }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    min-width: 100%;
    box-shadow: none;
    border: 1px solid var(--border);
    padding: 16px;
    margin-top: 8px;
    display: none;
  }
  .nav-dropdown:hover .nav-dropdown-menu {
    display: none; /* Disable hover on mobile */
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block; /* Toggle menu with JS class 'open' on mobile */
  }
  .nav-dropdown-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Premium Logo Styles */
.logo-icon {
  width: 36px !important;
  height: 36px !important;
  transition: var(--transition);
}

.logo:hover .logo-icon {
  transform: scale(1.05) rotate(-2deg);
}

.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary) !important;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
}

.logo-text span {
  color: var(--secondary) !important;
}
