/* ===========================
   CSS VARIABLES & THEME
   =========================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4ade80;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

/* ===========================
   THEME TOGGLE
   =========================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-icon {
    font-size: 1.5rem;
}

/* ===========================
   CONTAINER
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===========================
   HEADER
   =========================== */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* ===========================
   TABS NAVIGATION
   =========================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* ===========================
   TAB CONTENT
   =========================== */
.tab-content-container {
    min-height: 400px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ===========================
   CALCULATOR CARD
   =========================== */
.calculator-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.calculator-card h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

/* ===========================
   INPUT GROUPS
   =========================== */
.input-group {
    margin-bottom: 20px;
}

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

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tenure-input {
    display: flex;
    gap: 10px;
}

.tenure-input input {
    flex: 2;
}

.tenure-input select {
    flex: 1;
}

.error-msg {
    display: block;
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

/* ===========================
   RADIO BUTTONS
   =========================== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.radio-label input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-calculate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* ===========================
   RESULTS SECTION
   =========================== */
.results-section {
    transition: var(--transition);
}

.results-section.hidden {
    display: none;
}

/* ===========================
   SUMMARY CARDS
   =========================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.summary-card.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.card-icon {
    font-size: 2.5rem;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.card-sublabel {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 3px;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===========================
   CHARTS
   =========================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.chart-container canvas {
    max-height: 300px;
    width: 100% !important;
}

/* ===========================
   AMORTIZATION SECTION
   =========================== */
.amortization-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.amortization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.amortization-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export {
    padding: 10px 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 5px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.view-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Period Toggle */
.period-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 5px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.period-btn {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.period-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.period-btn.active {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

/* Table View */
.table-view {
    display: none;
}

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

/* Graph View */
.graph-view {
    display: none;
}

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

.graph-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    flex-wrap: wrap;
}

.graph-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.graph-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#amortizationGraph {
    width: 100% !important;
    max-height: 500px;
}

/* ===========================
   TABLE
   =========================== */
.table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    background: var(--primary-color);
    color: white;
    z-index: 10;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

td {
    padding: 12px 15px;
    text-align: left;
    color: var(--text-primary);
}

tbody tr:nth-child(even) {
    background: var(--bg-primary);
}

/* ===========================
   COMPARISON SECTION
   =========================== */
.comparison-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.comparison-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.comparison-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.comparison-item:last-child {
    border-bottom: none;
}

.comparison-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* ===========================
   SAVINGS CARD
   =========================== */
.savings-card {
    background: linear-gradient(135deg, var(--success-color), #22c55e);
    color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.savings-card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.savings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.saving-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-amount {
    font-size: 1.8rem;
    font-weight: 700;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container.full-width {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .comparison-section {
        grid-template-columns: 1fr;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
    
    .export-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-export {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .calculator-card {
        padding: 20px;
    }
    
    .card-value {
        font-size: 1.2rem;
    }
    
    th, td {
        padding: 10px;
        font-size: 0.85rem;
    }
}

.smart-footer {
  background: #0e1b27;
  padding: 30px 40px;
  border-radius: 30px;
  max-width: 1200px;
  margin: 60px auto;
  color: white;
}

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

/* Left */
.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0e2a52;
  display: flex;
  align-items: center;
  justify-content: center;
  color: gold;
  font-size: 22px;
  font-weight: bold;
}

.logo-text h3 {
  margin: 0;
  font-size: 20px;
}

.logo-text span {
  color: gold;
}

.logo-text p {
  margin: 0;
  font-size: 12px;
  opacity: 0.7;
}

/* Center */
.footer-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enquiry-title {
  font-size: 13px;
  opacity: 0.7;
}

.gmail-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: gold;
  text-decoration: none;
  font-size: 14px;
}

.gmail-link:hover {
  text-decoration: underline;
}

.gmail-icon {
  width: 40px;
  filter: invert(1);
}

.built-by {
  font-size: 18px;
  opacity: 0.8;
}

.copyright {
  font-size: 12px;
  opacity: 0.6;
}

/* Right */
.footer-right a {
  margin-left: 15px;
}

.footer-icon {
  width: 20px;
  filter: invert(1);
  transition: 0.3s;
}

.footer-icon:hover {
  transform: scale(1.2);
}

/* Mobile */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}


/* animation */
/* Ultra glass depth */
.smart-footer {
  background: linear-gradient(
    135deg,
    rgba(6, 18, 40, 0.85),
    rgba(14, 45, 95, 0.7)
  ) !important;

  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);

  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 1px rgba(255, 255, 255, 0.5);

  border-radius: 38px !important;
  position: relative;
  overflow: hidden;
}

/* Moving aurora glow */
.smart-footer::after {
  content: "";
  position: absolute;
  inset: -150%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 215, 0, 0.15),
    transparent 35%
  ),
  radial-gradient(
    circle at 70% 60%,
    rgba(0, 140, 255, 0.15),
    transparent 35%
  );
  animation: auroraMove 18s linear infinite;
  pointer-events: none;
}

@keyframes auroraMove {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10%, 5%) rotate(180deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* Floating hover depth */
.smart-footer:hover {
  transform: translateY(-4px);
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

/* Luxury underline shimmer */
.footer-center p,
.footer-left p,
.footer-left h3 {
  position: relative;
}

.footer-center p::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, gold, transparent);
  transition: width 0.6s ease;
}

.footer-center p:hover::after {
  width: 100%;
}

/* Icon orbit glow */
.footer-icon {
  filter: drop-shadow(0 0 0px transparent);
}

.footer-icon:hover {
  filter: drop-shadow(0 0 12px gold)
          drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
}

/* Gmail premium glow */
.gmail-link {
  position: relative;
}

.gmail-link::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  background: radial-gradient(circle, rgba(255,215,0,0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gmail-link:hover::after {
  opacity: 1;
}

/* Premium motion easing */
.smart-footer * {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* whole body a nimation */

/* mobile footer css */

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .footer-left {
    flex-direction: column;
    gap: 8px;
  }

  .logo-circle {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .logo-text h3 {
    font-size: 18px;
  }

  .logo-text p {
    font-size: 12px;
  }

  .footer-center {
    gap: 10px;
  }

  .gmail-link {
    font-size: 13px;
    word-break: break-all;
  }

  .footer-right {
    display: flex;
    justify-content: center;
    gap: 18px;
  }

  .footer-icon {
    width: 22px;
  }

  .smart-footer {
    padding: 24px 20px;
    border-radius: 26px;
  }
} 
/*  */
