/* ============================================================
   Edupidia EMI Calculator — Complete Styles
   Professional financial calculator with smooth animations
============================================================ */

:root {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #3b82f6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
body[data-theme="light"] {
  --bg:        #f6f7fb;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-soft: #475569;
  --text-muted:#64748b;
  --input-bg:  #ffffff;
  --ring:      rgba(99, 102, 241, 0.35);
  --navbar-bg: #ffffff;
  --footer-bg: #1e293b;
}

/* Dark theme */
body[data-theme="dark"] {
  --bg:        #0b1020;
  --surface:   #111831;
  --surface-2: #0f172a;
  --border:    #1f2a44;
  --text:      #e5e7eb;
  --text-soft: #cbd5e1;
  --text-muted:#94a3b8;
  --input-bg:  #0f172a;
  --ring:      rgba(129, 140, 248, 0.45);
  --navbar-bg: #111831;
  --footer-bg: #0b1020;
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ============================================================
   NAVBAR
============================================================ */
.edp-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.edp-navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.edp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  transition: transform var(--transition);
  letter-spacing: -0.02em;
}

.edp-logo:hover {
  transform: scale(1.05);
}

.edp-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 22px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  cursor: pointer;
}

.edp-logo:hover .edp-logo-icon {
  transform: rotate(-5deg);
  box-shadow: var(--shadow-lg);
}

.edp-logo-text {
  color: var(--text);
}

/* Hamburger Menu */
.edp-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  transition: all var(--transition);
}

.edp-hamburger span {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
}

.edp-hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.edp-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.edp-hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Nav Menu */
.edp-nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  transition: all var(--transition);
}

.edp-nav-link {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 0;
  position: relative;
  transition: color var(--transition);
}

.edp-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-600);
  transition: width var(--transition);
}

.edp-nav-link:hover {
  color: var(--brand-600);
}

.edp-nav-link:hover::after {
  width: 100%;
}

/* Mobile Responsive Navbar */
@media (max-width: 768px) {
  .edp-hamburger {
    display: flex;
  }

  .edp-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--navbar-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: 100px 32px 32px;
    gap: 24px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 999;
  }

  .edp-nav-menu.active {
    right: 0;
  }

  .edp-nav-link {
    font-size: 18px;
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .edp-nav-link::after {
    display: none;
  }
}

/* Overlay for mobile menu */
.edp-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition);
}

.edp-nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.edp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Breadcrumb */
.edp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-muted);
  animation: fadeIn 0.5s ease 0.1s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.edp-breadcrumb a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--transition);
}

.edp-breadcrumb a:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

.edp-breadcrumb li[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* Hero */
.edp-hero {
  margin-bottom: 32px;
  animation: fadeIn 0.6s ease 0.2s both;
}

.edp-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.edp-lead {
  color: var(--text-soft);
  font-size: clamp(15px, 2vw, 17px);
  max-width: 720px;
  margin: 0 0 28px;
}

/* Cards */
.edp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  animation: fadeInUp 0.6s ease both;
}

.edp-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.edp-card h2, .edp-card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.edp-card h2 { font-size: 22px; }
.edp-card h3 { font-size: 18px; }
.edp-card h4 { font-size: 15px; margin: 18px 0 6px; color: var(--text-soft); }

.edp-card-sub {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 14px;
}

/* Calculator Grid */
.edp-calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease 0.3s both;
}

@media (min-width: 900px) {
  .edp-calculator-grid { grid-template-columns: 1fr 1fr; }
}

/* Input Panel */
.edp-input-panel .edp-card-header {
  margin-bottom: 16px;
}

.edp-field { margin-bottom: 18px; }

.edp-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.edp-input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.edp-input-group input {
  flex: 1;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: all var(--transition);
}

.edp-input-group input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--ring);
}

.edp-input-group input.is-invalid {
  border-color: var(--danger);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.edp-input-prefix,
.edp-input-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  transition: all var(--transition);
}

.edp-input-prefix {
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.edp-input-suffix {
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.edp-input-prefix + input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

input + .edp-input-suffix {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.edp-error {
  color: var(--danger);
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 1em;
  animation: fadeIn 0.3s ease;
}

/* Tenure Group */
.edp-tenure-group {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.edp-tenure-group input[type="number"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: all var(--transition);
}

.edp-tenure-group input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--ring);
}

.edp-tenure-toggle {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

/* Radio buttons */
.edp-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  transition: color var(--transition);
}

.edp-radio-label:hover {
  color: var(--brand-600);
}

.edp-radio-label input[type="radio"] {
  cursor: pointer;
  transition: all var(--transition);
}

.edp-radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Actions */
.edp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

/* Buttons */
.edp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.edp-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.edp-btn:hover::before {
  width: 300px;
  height: 300px;
}

.edp-btn:hover {
  transform: translateY(-2px);
}

.edp-btn:active {
  transform: translateY(0);
}

.edp-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.edp-btn-primary {
  background: var(--brand-600);
  color: #fff;
}

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

.edp-btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.edp-btn-secondary:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-300);
}

body[data-theme="dark"] .edp-btn-secondary:hover {
  background: var(--border);
  color: var(--brand-300);
}

.edp-btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}

.edp-btn-ghost:hover {
  color: var(--brand-600);
  border-color: var(--brand-300);
}

.edp-btn-icon {
  padding: 10px 12px;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-soft);
}

.edp-btn-icon:hover {
  color: var(--brand-600);
  border-color: var(--brand-300);
}

.edp-btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* Disclaimer */
.edp-disclaimer-box {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  animation: fadeIn 0.5s ease;
}

.edp-disclaimer {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Results Panel */
.edp-results-panel {
  display: flex;
  flex-direction: column;
  animation: fadeInRight 0.6s ease;
}

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

.edp-results-heading {
  text-align: center;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.edp-emi-highlight {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.edp-emi-amount {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.edp-emi-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.edp-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.edp-summary-item {
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.edp-summary-item:nth-child(1) { animation-delay: 0.1s; }
.edp-summary-item:nth-child(2) { animation-delay: 0.2s; }
.edp-summary-item:nth-child(3) { animation-delay: 0.3s; }

.edp-summary-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.edp-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.edp-summary-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.edp-summary-value.edp-interest { color: var(--warning); }
.edp-summary-value.edp-total { color: var(--brand-600); }
body[data-theme="dark"] .edp-summary-value.edp-total { color: var(--brand-300); }

/* Chart */
.edp-chart-section {
  margin-bottom: 20px;
}

.edp-chart-section h3 {
  margin-bottom: 16px;
}

.edp-pie-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  animation: fadeIn 0.6s ease 0.4s both;
}

@media (min-width: 600px) {
  .edp-pie-chart-wrapper {
    flex-direction: row;
    justify-content: space-around;
  }
}

.edp-pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(var(--brand-600) 0deg, var(--brand-600) 0deg, var(--warning) 0deg, var(--warning) 360deg);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: rotateIn 1s ease;
}

@keyframes rotateIn {
  from {
    transform: rotate(-180deg);
    opacity: 0;
  }
  to {
    transform: rotate(0);
    opacity: 1;
  }
}

.edp-pie-chart::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: var(--surface);
  border-radius: 50%;
  transition: background var(--transition);
}

.edp-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edp-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: fadeInRight 0.5s ease both;
}

.edp-legend-item:nth-child(1) { animation-delay: 0.5s; }
.edp-legend-item:nth-child(2) { animation-delay: 0.6s; }

.edp-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  transition: transform var(--transition);
}

.edp-legend-color:hover {
  transform: scale(1.2);
}

.edp-color-principal { background: var(--brand-600); }
.edp-color-interest { background: var(--warning); }

.edp-legend-label {
  color: var(--text-soft);
  flex: 1;
}

.edp-legend-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Share actions */
.edp-share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.edp-copy-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
  min-height: 1em;
  animation: fadeIn 0.3s ease;
}

/* Tabs */
.edp-tabs-section {
  margin-top: 30px;
  animation: fadeIn 0.6s ease 0.5s both;
}

.edp-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.edp-tabs::-webkit-scrollbar {
  height: 4px;
}

.edp-tabs::-webkit-scrollbar-track {
  background: var(--surface-2);
}

.edp-tabs::-webkit-scrollbar-thumb {
  background: var(--brand-400);
  border-radius: 2px;
}

.edp-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
  position: relative;
}

.edp-tab::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--brand-600);
  transform: translateX(-50%);
  transition: width var(--transition);
}

.edp-tab:hover {
  color: var(--brand-600);
}

.edp-tab:hover::before {
  width: 100%;
}

.edp-tab.active {
  color: var(--brand-600);
}

.edp-tab.active::before {
  width: 100%;
}

body[data-theme="dark"] .edp-tab.active {
  color: var(--brand-300);
}

body[data-theme="dark"] .edp-tab.active::before {
  background: var(--brand-300);
}

.edp-tab-content {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.edp-tab-content.active {
  display: block;
}

/* Card header flex */
.edp-card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.edp-table-controls {
  display: flex;
  gap: 8px;
}

/* Tables */
.edp-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  scrollbar-width: thin;
}

.edp-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.edp-table-wrapper::-webkit-scrollbar-track {
  background: var(--surface-2);
}

.edp-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--brand-400);
  border-radius: 4px;
}

.edp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.edp-table thead {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.edp-table th {
  padding: 12px;
  text-align: right;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.edp-table th:first-child {
  text-align: left;
}

.edp-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  transition: background var(--transition-fast);
}

.edp-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

.edp-table tbody tr {
  transition: background var(--transition-fast);
}

.edp-table tbody tr:hover {
  background: var(--surface-2);
}

.edp-table tfoot {
  background: var(--surface-2);
  font-weight: 700;
}

.edp-table tfoot td {
  color: var(--text);
  border-top: 2px solid var(--border);
  border-bottom: none;
}

/* Pagination */
.edp-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.edp-pagination button {
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.edp-pagination button:hover:not(:disabled) {
  background: var(--brand-50);
  border-color: var(--brand-300);
  transform: translateY(-1px);
}

.edp-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.edp-pagination button.active {
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}

.edp-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* Mini forms */
.edp-mini-form .edp-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .edp-mini-form .edp-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Prepayment results */
.edp-prepay-results {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.edp-prepay-results:empty {
  display: none;
}

.edp-prepay-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  animation: fadeIn 0.3s ease both;
}

.edp-prepay-stat:nth-child(1) { animation-delay: 0.1s; }
.edp-prepay-stat:nth-child(2) { animation-delay: 0.15s; }
.edp-prepay-stat:nth-child(3) { animation-delay: 0.2s; }
.edp-prepay-stat:nth-child(4) { animation-delay: 0.25s; }
.edp-prepay-stat:nth-child(5) { animation-delay: 0.3s; }
.edp-prepay-stat:nth-child(6) { animation-delay: 0.35s; }
.edp-prepay-stat:nth-child(7) { animation-delay: 0.4s; }

.edp-prepay-stat:last-child {
  border-bottom: none;
}

.edp-prepay-label {
  color: var(--text-muted);
  font-size: 14px;
}

.edp-prepay-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.edp-prepay-value.edp-savings {
  color: var(--success);
}

.edp-footnote {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* Compare grid */
.edp-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 700px) {
  .edp-compare-grid { grid-template-columns: 1fr 1fr; }
}

.edp-compare-column {
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.edp-compare-column:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.edp-compare-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.5s ease;
}

.edp-compare-result:empty {
  display: none;
}

.edp-comparison-summary {
  padding: 16px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-200);
  animation: fadeInUp 0.5s ease;
}

body[data-theme="dark"] .edp-comparison-summary {
  background: var(--surface-2);
  border-color: var(--border);
}

.edp-comparison-summary:empty {
  display: none;
}

/* Result box */
.edp-result-box {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.edp-result-box:empty {
  display: none;
}

.edp-result-box p {
  margin: 6px 0;
}

/* Milestones */
.edp-milestones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .edp-milestones { grid-template-columns: repeat(2, 1fr); }
}

.edp-milestone {
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--brand-600);
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.edp-milestone:nth-child(1) { animation-delay: 0.1s; }
.edp-milestone:nth-child(2) { animation-delay: 0.2s; }
.edp-milestone:nth-child(3) { animation-delay: 0.3s; }
.edp-milestone:nth-child(4) { animation-delay: 0.4s; }

.edp-milestone:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.edp-milestone-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.edp-milestone-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* Insights */
.edp-insights-section {
  animation: fadeIn 0.6s ease 0.6s both;
}

.edp-insights-list {
  margin: 0;
  padding-left: 20px;
}

.edp-insights-list li {
  margin-bottom: 10px;
  color: var(--text-soft);
  line-height: 1.6;
  animation: fadeInUp 0.5s ease both;
}

.edp-insights-list li:nth-child(1) { animation-delay: 0.1s; }
.edp-insights-list li:nth-child(2) { animation-delay: 0.2s; }
.edp-insights-list li:nth-child(3) { animation-delay: 0.3s; }
.edp-insights-list li:nth-child(4) { animation-delay: 0.4s; }

/* Content sections */
.edp-content article {
  animation: fadeInUp 0.6s ease both;
}

.edp-content article:nth-child(1) { animation-delay: 0.7s; }
.edp-content article:nth-child(2) { animation-delay: 0.8s; }
.edp-content article:nth-child(3) { animation-delay: 0.9s; }
.edp-content article:nth-child(4) { animation-delay: 1.0s; }
.edp-content article:nth-child(5) { animation-delay: 1.1s; }
.edp-content article:nth-child(6) { animation-delay: 1.2s; }
.edp-content article:nth-child(7) { animation-delay: 1.3s; }

.edp-content article p,
.edp-content article li {
  color: var(--text-soft);
}

.edp-steps {
  padding-left: 22px;
}

.edp-steps li {
  margin-bottom: 8px;
}

/* Formula box */
.edp-formula-box {
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--brand-600);
  margin: 12px 0;
  overflow-x: auto;
  transition: all var(--transition);
}

.edp-formula-box:hover {
  border-left-width: 6px;
}

.edp-formula-box code {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--brand-700);
  white-space: nowrap;
}

body[data-theme="dark"] .edp-formula-box code {
  color: var(--brand-300);
}

/* FAQ */
#faq details {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  transition: all var(--transition);
}

#faq details:first-of-type {
  border-top: none;
}

#faq details[open] {
  background: var(--surface-2);
  padding: 14px;
  margin: 0 -14px;
  border-radius: var(--radius-sm);
}

#faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding-right: 28px;
  position: relative;
  color: var(--text);
  transition: color var(--transition);
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 0;
  font-size: 22px;
  color: var(--brand-500);
  transition: all var(--transition);
}

#faq summary:hover {
  color: var(--brand-600);
}

#faq details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

#faq details p {
  margin: 10px 0 0;
  color: var(--text-soft);
  animation: fadeIn 0.3s ease;
}

/* Footer */
.edp-footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 40px 20px;
  margin-top: 60px;
  animation: fadeIn 0.6s ease 1.4s both;
}

.edp-footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.edp-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.edp-footer-content p {
  margin: 0;
  color: #cbd5e1;
}

.edp-footer-links {
  display: flex;
  gap: 20px;
}

.edp-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color var(--transition);
}

.edp-footer-links a:hover {
  color: var(--brand-300);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Small screens */
@media (max-width: 420px) {
  .edp-main { padding: 18px 14px 60px; }
  .edp-card { padding: 18px; }
  .edp-actions .edp-btn { flex: 1 1 100%; }
  .edp-pie-chart { width: 150px; height: 150px; }
  .edp-pie-chart::after { width: 80px; height: 80px; }
  .edp-footer-content {
    flex-direction: column;
    text-align: center;
  }
}
