/* Common CSS for all pages */
:root {
  /* Color Palette */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #10b981;
  --background-color: #f1f5f9;
  --surface-color: #ffffff;
  --surface-variant: #f8fafc;
  --text-light: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --error-color: #ef4444;
  --success-color: #22c55e;
  --footer-bg: #ffffff;

  /* Form Input Styles */
  --input-padding: 0.75rem;
  --border-radius: 0.375rem;

  /* Shadows */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* body {
  font-family: "Inter", sans-serif;
  background: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
} */

/* Preloaded font family with swap */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  src: url(/static/inter-400.e89d1ff37e.woff2) format("woff2");
  font-display: swap; /* ensures text is visible while font loads */
}

body {
  font-family: "Inter", sans-serif;
  background: var(--background-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0; /* better than unset */
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 1rem;
}

.header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
}

.calculator-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.calculator-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #fff;
  padding: 1rem;
  border-radius: 12px 12px 0 0;
  min-width: 100%;
  max-width: 100%;
}

.calculator-body {
  min-width: 100%;
  max-width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1rem;
  width: 100%;
}

.form-label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.4;
  box-sizing: border-box;
  background-color: #fff;
}

.form-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.calculate-btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  cursor: pointer;
  font-weight: 600;
}

.result {
  display: none;
  margin-top: 1rem;
  background: var(--surface-color);
  padding: 1rem;
  border-left: 4px solid var(--secondary-color);
  border-radius: 6px;
}

.result.show {
  display: block;
}

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

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

.result-label {
  font-weight: 500;
}

.result-content {
  text-align: end;
}

.result-value {
  font-weight: 600;
  color: var(--secondary-color);
}

.footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 1rem;
}

.amount-in-words {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.error-message {
  text-align: center;
  color: var(--error-color);
}

.success-message {
  text-align: center;
  color: var(--success-color);
}

.savings-message {
  margin-top: 1rem;
  color: var(--success-color);
  font-weight: 600;
}

/* Secondary button (like Add Item) */
.secondary-btn {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.secondary-btn:hover {
  background-color: #e0e0e0;
  border-color: #aaa;
}

.terms-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.terms-section {
  margin-bottom: 2rem;
}

.terms-section:last-child {
  margin-bottom: 0;
}

.terms-section h1 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.terms-section h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.terms-section h3 {
  color: var(--text-primary);
  margin: 1.5rem 0 1rem;
  font-size: 1.25rem;
}

.terms-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.terms-section ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.terms-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.flex-container {
  display: flex;
  /* flex-wrap: wrap; */
  gap: 1rem;
  /* padding: 1rem auto; */
  justify-content: center;
}

.ads-container-vertical {
  display: block;
  width: 25%;
  padding: 1rem 0;
  background: #f3f4f6;
}

/* Responsive Design */
/* Tablet breakpoint */
@media (max-width: 1024px) {
  .container {
    padding: 1.5rem;
    max-width: 95%;
  }

  .calculator-card {
    padding: 1.5rem;
    min-width: 85%;
  }

  .calculator-header {
    min-width: 100%;
  }

  .calculator-body {
    min-width: 100%;
  }

  .flex-container {
    flex-direction: column;
    gap: 0;
  }
  .ads-container-vertical {
    height: 280px;
    width: 100%;
    padding: 1rem;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .flex-container {
    flex-direction: column;
    gap: 0;
  }
  .ads-container-vertical {
    height: 280px;
    width: 100%;
    padding: 1rem;
  }

  .container {
    margin: 0 auto;
    min-width: 90%;
    padding: 1rem;
  }

  .calculator-card {
    min-width: 90%;
    max-width: 95%;
    padding: 1rem;
  }

  .calculator-header {
    margin: 0 auto;
    min-width: 90%;
    max-width: 100%;
  }

  .calculator-body {
    margin: 0 auto;
    min-width: 90%;
    max-width: 100%;
  }

  /* Improve form elements on mobile */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
  }

  /* Improve button touch targets */
  button {
    min-height: 44px; /* Apple's recommended minimum */
    padding: 0.75rem 1rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .flex-container {
    flex-direction: column;
    gap: 0;
  }
  .ads-container-vertical {
    height: 280px;
    width: 100%;
    padding: 1rem;
  }

  .container {
    padding: 0.75rem;
  }

  .calculator-card {
    padding: 0.75rem;
    margin: 0.25rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .input-group {
    flex-direction: column;
  }

  .input-group > * {
    width: 100%;
  }
}
