/* ================================
   EMI CALCULATOR — MODERN STYLES
   ================================ */

/* ===== Results Container ===== */
.emi-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  animation: emiFadeIn 0.4s ease;
}

@keyframes emiFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.emi-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.emi-stat strong {
  font-size: 1.2rem;
  color: var(--accent);
}

.emi-stat.highlight {
  border-color: var(--accent);
}

.emi-stat.highlight strong {
  font-size: 1.4rem;
}

/* ===== Action Buttons Container ===== */
.tool-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== Action Button Base ===== */
.action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  min-width: 180px;
  height: 52px;
  border: none;
  border-radius: 18px;
  font-family: "Galano Grotesque", Poppins, Montserrat, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== Action Button Icon ===== */
.action-btn__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.action-btn:hover .action-btn__icon {
  transform: translateY(-1px);
}

/* ===== Action Button Text ===== */
.action-btn__text {
  position: relative;
  z-index: 1;
}

/* ===== Share Button (Dark Glass) ===== */
.action-btn--share {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.action-btn--share::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-btn--share:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(255, 255, 255, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.action-btn--share:hover::before {
  opacity: 1;
}

/* ===== Download PDF Button (Green Gradient) ===== */
.action-btn--pdf {
  background: linear-gradient(135deg, #00C853, #00A844);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 200, 83, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.action-btn--pdf::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-btn--pdf:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 200, 83, 0.4),
              0 0 20px rgba(0, 200, 83, 0.15);
}

.action-btn--pdf:hover::before {
  opacity: 1;
}

.action-btn--pdf:disabled {
  background: linear-gradient(135deg, #2a5a3a, #1a4a2a);
  box-shadow: none;
  border-color: rgba(0, 200, 83, 0.1);
}

/* ===== PDF Loading State ===== */
.action-btn--pdf.loading {
  cursor: wait;
  pointer-events: none;
}

.action-btn--pdf.loading .action-btn__text {
  opacity: 0.6;
}

.action-btn__loader {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-btn--pdf.loading .action-btn__loader {
  display: inline-flex;
}

.action-btn__spinner {
  animation: actionBtnSpin 1s linear infinite;
}

@keyframes actionBtnSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Toast Notification ===== */
.pdf-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.pdf-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pdf-toast--success {
  background: #00C853;
  color: #fff;
}

.pdf-toast--error {
  background: #FF3D3D;
  color: #fff;
}

.pdf-toast--info {
  background: #2962FF;
  color: #fff;
}

.pdf-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.pdf-toast-msg {
  white-space: nowrap;
}

/* ===== Amortization Schedule Table ===== */
.schedule-wrapper {
  overflow-x: auto;
  margin-top: 16px;
}

.schedule-wrapper h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--text);
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.amortization-table thead tr {
  background: var(--accent);
  color: #fff;
}

.amortization-table th {
  padding: 8px 6px;
  text-align: left;
}

.amortization-table th:not(:first-child) {
  text-align: right;
}

.amortization-table td {
  padding: 6px;
}

.amortization-table td:not(:first-child) {
  text-align: right;
}

.amortization-table tbody tr:nth-child(even) {
  background: var(--bg-card);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 540px) {
  .tool-actions {
    flex-direction: column;
    gap: 12px;
  }

  .action-btn {
    width: 100%;
    min-width: unset;
    padding: 14px 20px;
    height: 50px;
    font-size: 15px;
    justify-content: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .pdf-toast {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: translateY(20px);
    justify-content: center;
  }

  .pdf-toast--visible {
    transform: translateY(0);
  }

  .schedule-wrapper {
    margin-top: 12px;
  }

  .amortization-table {
    font-size: 0.75rem;
  }

  .amortization-table th,
  .amortization-table td {
    padding: 5px 4px;
  }
}

/* Tablet: keep buttons side by side */
@media (min-width: 541px) and (max-width: 900px) {
  .action-btn {
    min-width: 160px;
    padding: 12px 20px;
    font-size: 15px;
    height: 48px;
  }
}

/* ===== Input base styles (prevents iOS zoom) ===== */
input, textarea, select {
  font-size: 16px;
  width: 100%;
  max-width: 100%;
}
