/* ===== CALCULATOR MODALS - NEW DESIGN ===== */

/* Calculator Modal Specific */
.calc-modal-content {
  max-width: 1000px !important;
  max-height: 92vh;
  width: 95%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.calc-modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
}
.calc-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.calc-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.calc-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}
.calc-modal-header p {
  font-size: 0.85rem;
  opacity: 0.9;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.tn-tariff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e67e22;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 8px;
}
.calc-modal-header .modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
}
.calc-modal-header .modal-close:hover { background: rgba(255,255,255,0.3); }
.calc-modal-body {
  padding: 32px;
  background: #f8fafc;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Input Grid */
.calc-input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.calc-input-col label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.calc-input-col input,
.calc-input-col select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  cursor: text;
  transition: 0.3s ease;
}
.calc-input-col input:focus,
.calc-input-col select:focus {
  outline: none;
  border-color: #3498db;
}
.calc-input-col small {
  display: block;
  font-size: 0.8rem;
  color: #3498db;
  font-weight: 600;
  margin-top: 4px;
}
.calc-input-col .helper-text {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 6px;
}
.badge-blue {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}
.badge-gray {
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Tariff Info Box */
.tariff-info-box {
  background: #fef3e7;
  border: 2px solid #f39c12;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.tariff-info-box h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e67e22;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.tariff-slabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tariff-slabs .slab {
  background: #fff;
  border: 1px solid #f39c12;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tariff-slabs .slab.free { background: #d4edda; border-color: #28a745; color: #155724; }
.tariff-slabs .slab-label { color: #475569; margin-right: 4px; }
.tariff-slabs .slab-value { color: #1a1a2e; font-weight: 700; }
.tariff-info-box button {
  margin-top: 12px;
  background: #fff;
  border: 2px solid #e67e22;
  color: #e67e22;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.3s ease;
}
.tariff-info-box button:hover {
  background: #e67e22;
  color: #fff;
}

/* Analysis Section */
.analysis-section {
  margin-bottom: 24px;
}
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}
.analysis-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: #1a1a2e;
  margin: 0;
}
.analysis-subtitle {
  font-size: 0.8rem;
  color: #475569;
  margin: 0;
  text-align: right;
  font-weight: 500;
}
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.analysis-card {
  padding: 18px 14px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 110px;
}
.analysis-card.beige { background: #fef5e7; }
.analysis-card.yellow { background: #fef9e3; }
.analysis-card.green { background: #d5f5e3; }
.analysis-card.blue { background: #ebf5fb; }
.analysis-card i {
  font-size: 1.4rem;
  opacity: 0.6;
}
.analysis-card.beige i { color: #e67e22; }
.analysis-card.yellow i { color: #f39c12; }
.analysis-card.green i { color: #27ae60; }
.analysis-card.blue i { color: #3498db; }
.analysis-card strong {
  font-size: 1.35rem;
  color: #1a1a2e;
  font-weight: 800;
  line-height: 1.2;
}
.analysis-card span {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.35;
  max-width: 100%;
}

/* Financial Summary */
.financial-summary {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.summary-row.no-subsidy-row {
  grid-template-columns: repeat(3, 1fr);
}
.summary-row:last-of-type { margin-bottom: 0; }
.summary-card {
  padding: 16px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 2px solid transparent;
  min-height: 88px;
}
.summary-card > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.summary-card i {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.summary-card small {
  display: block;
  font-size: 0.7rem;
  color: #475569;
  margin-bottom: 6px;
  line-height: 1.35;
  min-height: 2.5em;
}
.summary-card strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}
.summary-card .note-text {
  display: block;
  font-size: 0.65rem;
  color: #e67e22;
  margin-top: 4px;
}
.summary-card.red-light { background: #ffe6e6; border-color: #ffcccc; }
.summary-card.red-light i { color: #e74c3c; }
.summary-card.green-light { background: #d5f5e3; border-color: #a9dfbf; }
.summary-card.green-light i { color: #27ae60; }
.summary-card.orange-light { background: #fef5e7; border-color: #fdebd0; }
.summary-card.orange-light i { color: #e67e22; }
.summary-card.purple-light { background: #f4ecf7; border-color: #e8daef; }
.summary-card.purple-light i { color: #8e44ad; }
.summary-card.gray-light { background: #ecf0f1; border-color: #d5d8dc; }
.summary-card.gray-light i { color: #7f8c8d; }
.summary-card.blue-light { background: #ebf5fb; border-color: #d6eaf8; }
.summary-card.blue-light i { color: #3498db; }
.summary-footer {
  text-align: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #475569;
  margin-top: 16px;
}
.summary-footer strong {
  color: #1a1a2e;
  font-weight: 700;
}
.disclaimer {
  font-size: 0.7rem;
  color: #475569;
  line-height: 1.5;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* Calculator Actions */
.calc-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.btn-calc-secondary,
.btn-calc-primary {
  flex: 1;
  padding: 14px 24px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.3s ease;
  border: none;
  text-decoration: none;
}
.btn-calc-secondary {
  background: #fff;
  color: #475569;
  border: 2px solid #d1d5db;
}
.btn-calc-secondary:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
}
.btn-calc-primary {
  background: #25d366;
  color: #fff;
  border: 2px solid #25d366;
}
.btn-calc-primary:hover {
  background: #1da851;
  border-color: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.35);
}

/* EMI Modal Specific */
.emi-modal-content {
  max-width: 1100px !important;
  max-height: 92vh;
  width: 95%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.emi-modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
}
.emi-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.emi-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.emi-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.emi-modal-header p {
  font-size: 0.85rem;
  opacity: 0.9;
}
.emi-modal-body {
  padding: 32px;
  background: #f8fafc;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Smart Truth Banner */
.smart-truth-banner {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 2px solid #2196f3;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.smart-truth-banner i {
  font-size: 1.8rem;
  color: #1976d2;
  flex-shrink: 0;
}
.smart-truth-banner p {
  font-size: 0.9rem;
  color: #1a1a2e;
  line-height: 1.5;
}
.smart-truth-banner strong {
  font-weight: 700;
}
.highlight-blue {
  color: #1976d2;
  font-weight: 700;
}
.highlight-green {
  color: #27ae60;
  font-weight: 700;
}

/* EMI Input Grid */
.emi-input-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.emi-input-col label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-symbol .symbol {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}
.input-with-symbol .symbol:first-child {
  left: 14px;
}
.input-with-symbol .symbol:last-child {
  right: 14px;
}
.input-with-symbol input {
  width: 100%;
  padding: 12px 40px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  cursor: text;
  transition: 0.3s ease;
  text-align: center;
}
.input-with-symbol input:focus {
  outline: none;
  border-color: #3498db;
}
.emi-input-col small {
  display: block;
  font-size: 0.7rem;
  color: #475569;
  margin-top: 6px;
  line-height: 1.3;
}

/* EMI Comparison Cards */
.emi-comparison {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.comparison-card {
  flex: 1;
  padding: 24px;
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 3px solid transparent;
}
.comparison-card.red-card {
  background: #ffe6e6;
  border-color: #ffcccc;
}
.comparison-card.green-card {
  background: #d5f5e3;
  border-color: #a9dfbf;
}
.comparison-card i {
  font-size: 2rem;
  flex-shrink: 0;
  margin-top: 4px;
}
.comparison-card.red-card i { color: #e74c3c; }
.comparison-card.green-card i { color: #27ae60; }
.comparison-card span {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 6px;
}
.comparison-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.comparison-card small {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.4;
}
.comparison-card .yearly-cost {
  font-size: 0.8rem;
  color: #e74c3c;
  font-weight: 600;
  margin-top: 8px;
}
.comparison-card .emi-free {
  font-size: 0.85rem;
  color: #27ae60;
  font-weight: 700;
  margin-top: 8px;
}
.vs-badge {
  background: #e67e22;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Monthly Saving Highlight */
.monthly-saving-highlight {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 2px solid #ffa726;
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.monthly-saving-highlight i {
  font-size: 2.5rem;
  color: #f57c00;
  flex-shrink: 0;
}
.monthly-saving-highlight > div:first-of-type {
  flex: 1;
}
.monthly-saving-highlight span {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 4px;
}
.monthly-saving-highlight strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: #e67e22;
}
.saving-badge-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.saving-badge-group > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.saving-badge-group small {
  font-size: 0.7rem;
  color: #475569;
}
.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #27ae60;
  color: #fff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
}
.total-saving-amount {
  font-size: 1.3rem;
  font-weight: 800;
  color: #22c55e;
}

/* Year Comparison Table */
.year-comparison-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.year-comparison-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #1a1a2e;
  margin-bottom: 16px;
}
.year-table-wrapper {
  overflow-x: auto;
  margin-bottom: 12px;
}
.year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.year-table thead {
  background: #1a1a2e;
  color: #fff;
}
.year-table th {
  padding: 12px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.year-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.year-table tbody tr:hover {
  background: #f8fafc;
}
.year-table .period-col {
  font-weight: 700;
  color: #1a1a2e;
}
.year-table .eb-bill-col {
  color: #e74c3c;
  font-weight: 600;
}
.year-table .emi-col {
  color: #3498db;
  font-weight: 600;
}
.year-table .saving-col {
  color: #27ae60;
  font-weight: 700;
}
.year-table .status-col span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}
.year-table .status-paying {
  background: #e3f2fd;
  color: #1976d2;
}
.year-table .status-free {
  background: #d5f5e3;
  color: #1e8449;
}
.year-table tr.highlight-row {
  background: #fff8dc;
}
.table-footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 8px;
}
.table-footer-info i {
  color: #3498db;
  flex-shrink: 0;
}
.table-footer-info strong {
  color: #1a1a2e;
  font-weight: 700;
}
.disclaimer-emi {
  font-size: 0.7rem;
  color: #475569;
  line-height: 1.5;
}

/* EMI Actions */
.emi-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.btn-emi-secondary,
.btn-emi-primary {
  flex: 1;
  padding: 14px 24px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.3s ease;
  border: none;
  text-decoration: none;
}
.btn-emi-secondary {
  background: #fff;
  color: #475569;
  border: 2px solid #d1d5db;
}
.btn-emi-secondary:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
}
.btn-emi-primary {
  background: #25d366;
  color: #fff;
  border: 2px solid #25d366;
}
.btn-emi-primary:hover {
  background: #1da851;
  border-color: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.35);
}

/* Responsive */
@media (max-width: 1024px) {
  .calc-input-grid,
  .emi-input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .calc-input-grid,
  .emi-input-grid,
  .analysis-grid,
  .summary-row,
  .summary-row.no-subsidy-row {
    grid-template-columns: 1fr;
  }
  .analysis-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .analysis-subtitle { text-align: left; }
  .emi-comparison {
    flex-direction: column;
  }
  .vs-badge {
    transform: rotate(90deg);
  }
  .calc-actions,
  .emi-actions {
    flex-direction: column;
  }
}
