/* Progress Bar */
.progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  position: relative;
}

.progress::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  transform: translateY(-50%);
  z-index: 0;
}

.step {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.step.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  padding: 25px;
  border-radius: 16px;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.4s ease;
}

.card.active {
  display: block;
}

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

/* Inputs */
label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
  font-size: 14px;
}

input,
select {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.25s ease;
  background: #f9fafb;
}

input:focus,
select:focus {
  border-color: #22c55e;
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Buttons */
button {
  padding: 12px 28px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 14px;
  min-width: 150px;
  max-width: 250px;
  display: block;
  text-align: center;
  margin: 20px auto 0;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

button:active {
  transform: scale(0.97);
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.nav-buttons button {
  flex: 1 1 45%;
  max-width: 48%;
  margin: 0;
  padding: 9px 10px;
}

/* Result Box */
.result-box {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #d1fae5;
  margin-top: 10px;
}

.zakat {
  font-size: 22px;
  font-weight: bold;
  color: #16a34a;
  margin-top: 5px;
}

.explanation {
  margin-top: 15px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

.disclaimer {
  margin-top: 15px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* Two inputs per row */
.input-row {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.input-row .input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ================= RESPONSIVE FIXES ================= */

/* Stack inputs properly */
@media (max-width: 700px) {
  .input-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* General mobile improvements */
@media (max-width: 600px) {
  .card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  button {
    width: 100%;
    max-width: 100%;
    padding: 9px 16px; /* ← smaller (was 12px 28px) */
    font-size: 13px; /* ← smaller (was 14px) */
    min-width: unset; /* ← removes the 150px floor */
    margin-top: 14px;
  }

  .nav-buttons button {
    flex: 1 1 45%; /* ← side by side (was 100%) */
    max-width: 48%;
    margin: 0;
  }

  .result-box {
    padding: 15px;
  }

  .zakat {
    font-size: 18px;
  }
}

/* Small screens */
@media (max-width: 500px) {
  .progress {
    gap: 5px;
  }

  .step {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  label {
    font-size: 13px;
  }

  input,
  select {
    font-size: 13px;
    padding: 10px;
  }
}
/* ================= COUNTRY SELECTOR ================= */

.country-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.selector-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.selector-wrapper {
  position: relative;
}

.selector-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s ease;
  min-width: 180px;
  margin: 0;
  max-width: none;
}

.selector-trigger:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  transform: none;
}

.selector-trigger.open {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.selector-arrow {
  margin-left: auto;
  font-size: 11px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.selector-trigger.open .selector-arrow {
  transform: rotate(180deg);
}

.selector-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 240px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 999;
  overflow: hidden;
  display: none;
  animation: dropdownIn 0.2s ease;
}

.selector-dropdown.open {
  display: block;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.country-list {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.country-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: background 0.15s ease;
  border-radius: 8px;
}

.country-list li:hover {
  background: rgba(34, 197, 94, 0.07);
  color: #15803d;
}

.country-list li.selected {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  font-weight: 600;
}

.country-list li .c-flag {
  font-size: 20px;
  line-height: 1;
}

.country-list li .c-name {
  flex: 1;
}

.country-list li .c-currency {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
}

.country-list .no-results {
  padding: 12px 14px;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  cursor: default;
}

.country-list .no-results:hover {
  background: none;
  color: #9ca3af;
}

@media (max-width: 500px) {
  .country-selector {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .selector-trigger {
    min-width: 160px;
  }
}
/* ================= TOOLTIP STYLES ================= */

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  cursor: default;
}

/* Override label's own margin-top when it's inside tooltip-wrap */
.tooltip-wrap label {
  margin-top: 0;
  cursor: default;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  user-select: none;
}

.tooltip-icon:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.tooltip-box {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;

  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  transform: translateY(4px);

  min-width: 200px;
  max-width: 260px;
  padding: 10px 13px;

  background: rgba(220, 252, 231, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 10px;
  box-shadow:
    0 8px 24px rgba(22, 163, 74, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.06);

  font-size: 12.5px;
  font-weight: 500;
  color: #14532d;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  z-index: 9999;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Down-pointing arrow */
.tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  border: 6px solid transparent;
  border-top-color: rgba(34, 197, 94, 0.4);
}

.tooltip-box::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 19px;
  border: 5px solid transparent;
  border-top-color: rgba(220, 252, 231, 0.97);
  z-index: 1;
}

/* Show tooltip on hover */
.tooltip-icon:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 500px) {
  .tooltip-box {
    min-width: 160px;
    max-width: 210px;
    font-size: 12px;
  }
}

/* ================= RESULT PAGE LINKS ================= */

.result-links {
  margin-top: 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1.5px solid #bbf7d0;
  border-radius: 14px;
  text-align: center;
}

.result-links-heading {
  font-size: 15px;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 14px;
}

.result-links-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.result-link-btn--primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.result-link-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

.result-link-btn--secondary {
  background: white;
  color: #16a34a;
  border: 1.5px solid #22c55e;
}

.result-link-btn--secondary:hover {
  background: rgba(34, 197, 94, 0.07);
  transform: translateY(-2px);
}

@media (max-width: 500px) {
  .result-links-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .result-link-btn {
    justify-content: center;
  }
}
