/* =============================================
   QASMIYAH ZAKAT CALCULATOR — Premium Islamic Theme
   ============================================= */

/* ---------- Google Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Inter:wght@300;400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap");

/* ---------- CSS Variables ---------- */
:root {
  --primary: #d4af37;
  --primary-light: #e8c84f;
  --primary-dark: #b8941f;
  --gold: #d4af37;
  --gold-light: #e8c84f;
  --gold-dark: #b8941f;
  --white: #ffffff;
  --cream: #ffffff;
  --cream-dark: #faf9f2;
  --text-dark: #2d240c;
  --text-mid: #725a1d;
  --text-light: #a38b55;
  --danger: #e53e3e;
  --success: #b8941f;
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(212, 175, 55, 0.35);
  --shadow-sm: 0 2px 12px rgba(212, 175, 55, 0.1);
  --shadow-md: 0 8px 32px rgba(212, 175, 55, 0.15);
  --shadow-lg: 0 20px 60px rgba(212, 175, 55, 0.2);
  --radius: 18px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: "Amiri", serif;
  --font-body: "Inter", sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", serif;
  --header-h: 72px;
  --summary-h: 130px;
}

/* ---------- Dark Mode Variables ---------- */
[data-theme="dark"] {
  --cream: #121008;
  --cream-dark: #121008;
  --glass-bg: rgba(30, 25, 10, 0.92);
  --glass-border: rgba(212, 175, 55, 0.25);
  --text-dark: #fbf8e8;
  --text-mid: #d4af37;
  --text-light: #a38b55;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
  display: flex;
  flex-direction: column;
}

/* RTL Support */
[dir="rtl"] body {
  font-family: var(--font-urdu), var(--font-body);
}
[dir="rtl"] .section-icon-wrap svg {
  transform: scaleX(-1);
}

/* ---------- Islamic Geometric Background ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.4' opacity='0.08'%3E%3Cpolygon points='50,5 95,27.5 95,72.5 50,95 5,72.5 5,27.5'/%3E%3Cpolygon points='50,20 80,35 80,65 50,80 20,65 20,35'/%3E%3Cline x1='50' y1='5' x2='50' y2='20'/%3E%3Cline x1='95' y1='27.5' x2='80' y2='35'/%3E%3Cline x1='95' y1='72.5' x2='80' y2='65'/%3E%3Cline x1='50' y1='95' x2='50' y2='80'/%3E%3Cline x1='5' y1='72.5' x2='20' y2='65'/%3E%3Cline x1='5' y1='27.5' x2='20' y2='35'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  opacity: 0.4;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--gold);
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
  padding-top: env(safe-area-inset-top);
  flex-wrap: nowrap;
}

[data-theme="dark"] .app-header {
  background: var(--cream);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-name {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 4.5vw, 1.35rem);
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(212, 175, 55, 0.2);
}

.app-subtitle {
  font-size: 0.55rem;
  color: var(--text-mid);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ramadan-badge {
  background: linear-gradient(
    135deg,
    var(--gold-dark),
    var(--gold),
    var(--gold-light)
  );
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  white-space: nowrap;
  display: inline-block;
  margin-bottom: 15px;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 2px 20px rgba(212, 175, 55, 0.7); }
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 10px;
}

@media (max-width: 480px) {
  .header-center {
    display: none;
  }
}

.hero-badge-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lang-select {
  background: var(--white);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.7rem;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  max-width: 80px;
}

.lang-select:hover {
  background: var(--cream-dark);
}
.lang-select option {
  background: var(--white);
  color: var(--text-dark);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--white);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
  transform: scale(1.1);
}
.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.5));
}

/* ---------- Crescent Hero ---------- */
.hero-section {
  position: relative;
  background: var(--white);
  padding: 32px 20px 48px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  border-bottom: 1px solid var(--glass-border);
}

[data-theme="dark"] .hero-section {
  background: var(--cream);
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--cream);
  clip-path: ellipse(55% 100% at 50% 100%);
}

[data-theme="dark"] .hero-section::after {
  display: none;
}

.hero-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.lantern-svg {
  position: absolute;
  top: 10px;
  right: 16px;
  opacity: 0.25;
  transform-origin: top center;
}

.lantern-svg-left {
  left: 16px;
  right: auto;
  animation-delay: -2s;
}

@keyframes lanternSwing {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

.crescent-svg {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.12;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--gold);
  margin-bottom: 4px;
  position: relative;
  text-shadow: 0 2px 20px rgba(212, 175, 55, 0.3);
}

.hero-arabic {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-mid);
  margin-bottom: 12px;
  direction: rtl;
}

.hero-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- Currency Nisab Bar ---------- */
.options-bar {
  display: flex;
  align-items: center;
  justify-content: center; /* Center since currency is gone */
  gap: 12px;
  padding: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 2;
}

[data-theme="dark"] .options-bar {
  background: var(--cream);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.option-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.option-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.styled-select {
  flex: 1;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--glass-bg);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.styled-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ---------- Nisab Toggle ---------- */
.nisab-toggle {
  display: flex;
  background: var(--cream-dark);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.nisab-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
}

.nisab-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* ---------- Main Content ---------- */
.main-content {
  position: relative;
  z-index: 1;
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* ---------- Accordion Section ---------- */
.calc-section {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: none;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  transition: var(--transition);
}

.calc-section:nth-child(1) {
  animation-delay: 0.05s;
}
.calc-section:nth-child(2) {
  animation-delay: 0.1s;
}
.calc-section:nth-child(3) {
  animation-delay: 0.15s;
}
.calc-section:nth-child(4) {
  animation-delay: 0.2s;
}
.calc-section:nth-child(5) {
  animation-delay: 0.25s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calc-section:hover {
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.section-icon-wrap {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.section-icon-wrap svg {
  stroke-width: 2.2;
}

.section-info {
  flex: 1;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.section-total-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-dark);
  background: rgba(212, 175, 55, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 2px;
  display: inline-block;
  transition: var(--transition);
}

[data-theme="dark"] .section-total-badge {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

.section-total-badge.has-value {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.chevron {
  font-size: 0.85rem;
  color: var(--text-light);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.calc-section.open .chevron {
  transform: rotate(180deg);
}

/* ---------- Section Body ---------- */
.section-body {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  opacity: 0;
}

.calc-section.open .section-body {
  max-height: 1000px;
  opacity: 1;
}

.section-inner {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--glass-border);
}

/* ---------- Islamic Divider ---------- */
.islamic-divider {
  text-align: center;
  margin: 4px 0 8px;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.islamic-divider::before,
.islamic-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.divider-star {
  font-size: 0.65rem;
  color: var(--gold);
  opacity: 0.7;
}

/* ---------- Input Groups ---------- */
.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .input-row {
    grid-template-columns: 1fr 1fr;
  }
}



.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tooltip-icon {
  width: 14px;
  height: 14px;
  background: var(--gold-dark);
  color: white;
  border-radius: 50%;
  font-size: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  font-style: normal;
  font-weight: 700;
  flex-shrink: 0;
}

.tooltip-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-dark);
  color: white;
  font-size: 0.68rem;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 200px;
  white-space: normal;
  width: max-content;
  max-width: 180px;
  text-align: center;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
}

.tooltip-icon:hover::after {
  opacity: 1;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-dark);
  pointer-events: none;
  z-index: 1;
  min-width: 22px;
}

[dir="rtl"] .currency-prefix {
  left: auto;
  right: 10px;
}

.calc-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

[dir="rtl"] .calc-input {
  padding: 10px 34px 10px 12px;
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

.calc-input::placeholder {
  color: var(--text-light);
  font-size: 0.8rem;
}

.calc-input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.calc-input:hover {
  border-color: var(--primary-light);
}

[data-theme="dark"] .calc-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.15);
  color: var(--text-dark);
}

[data-theme="dark"] .calc-input:focus {
  background: rgba(255, 255, 255, 0.1);
}

.input-error {
  font-size: 0.65rem;
  color: var(--danger);
  display: none;
  margin-top: 2px;
}

.calc-input.invalid {
  border-color: var(--danger);
}
.calc-input.invalid + .input-error {
  display: block;
}

/* ---------- Liabilities Section (special) ---------- */
.section-liability .section-icon-wrap {
  background: linear-gradient(135deg, #8b1a1a, #c0392b);
}

.section-liability .section-total-badge {
  color: var(--danger);
  background: rgba(229, 62, 62, 0.08);
}
.section-liability .section-total-badge.has-value {
  background: linear-gradient(135deg, #8b1a1a, #c0392b);
  color: white;
}

/* ---------- Nisab Info Box ---------- */
.nisab-info {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.04),
    rgba(212, 175, 55, 0.08)
  );
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-mid);
}

.nisab-info-icon {
  stroke: var(--gold);
  flex-shrink: 0;
}

.nisab-info strong {
  color: var(--primary);
  font-size: 0.85rem;
}
[data-theme="dark"] .nisab-info strong {
  color: var(--gold);
}

/* ---------- Action Buttons ---------- */
.action-row {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding: 0;
  width: 100%;
}

.btn {
  flex: 1;
  min-width: 100%;
  padding: 16px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.5px;
  box-shadow: none;
}

.btn:active {
  background-color: rgba(0,0,0,0.05);
}

.btn:hover {
  transform: none;
  box-shadow: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: linear-gradient(
    135deg,
    var(--gold-dark),
    var(--gold),
    var(--gold-light)
  );
  color: var(--white);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #d4af37, #b8941f);
  color: white;
}

.btn-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}

.btn-danger {
  background: rgba(229, 62, 62, 0.08);
  color: var(--danger);
  border: 1.5px solid rgba(229, 62, 62, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ---------- Sticky Summary Panel ---------- */
.summary-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.summary-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

@keyframes slideUpPanel {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.summary-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  gap: 12px;
}

@media (max-width: 480px) {
  .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 6px;
  }
}

.summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  position: relative;
}

/* Horizontal Dividers for Desktop */
@media (min-width: 481px) {
  .summary-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: var(--glass-border);
    opacity: 0.6;
  }
}

.summary-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.summary-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dark);
  transition: var(--transition);
}

.summary-zakat .summary-label {
  color: var(--gold);
}

.summary-zakat .summary-value {
  font-size: 1.15rem;
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Zakat Status ---------- */
.zakat-status {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  display: none;
  max-width: 720px;
  margin: 0 16px 4px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.zakat-status.show {
  display: block;
}

.zakat-status.obligatory {
  background: rgba(212, 175, 55, 0.08);
  border: 1.5px solid var(--gold);
  color: var(--gold-dark);
}

[data-theme="dark"] .zakat-status.obligatory {
  color: var(--gold);
}

.zakat-status.not-obligatory {
  background: var(--white);
  border: 1.5px solid var(--text-light);
  color: var(--text-mid);
}

/* ---------- Footer ---------- */
.app-footer {
  background: var(--white);
  border-top: 1px solid var(--glass-border);
  color: var(--text-mid);
  padding: 32px 20px calc(var(--summary-h) + 24px + env(safe-area-inset-bottom));
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-quran {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold);
  direction: rtl;
  margin-bottom: 8px;
  line-height: 1.8;
}

.footer-verse-ref {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-bottom: 20px;
  display: block;
}

.footer-divider {
  margin: 16px auto;
  max-width: 200px;
  opacity: 0.4;
}

.footer-note {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto;
}

.footer-brand {
  margin-top: 16px;
  font-size: 0.68rem;
  color: var(--text-light);
}


.install-banner-icon {
  font-size: 1.5rem;
}
.install-banner-text {
  flex: 1;
}
.install-banner-title {
  font-weight: 700;
  font-size: 0.85rem;
}
.install-banner-sub {
  font-size: 0.72rem;
  opacity: 0.8;
}

.install-btn {
  padding: 6px 14px;
  background: var(--gold);
  color: var(--primary-dark);
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.install-btn:hover {
  background: var(--gold-light);
}
.install-dismiss {
  cursor: pointer;
  opacity: 0.6;
  font-size: 1.2rem;
  padding: 4px;
}

/* ---------- Number Pulse Animation ---------- */
@keyframes numPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}



/* ---------- Scrollbar Styles ---------- */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ---------- Loading Spinner ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}

.page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-crescent {
  font-size: 3rem;
  margin-bottom: 16px;
}

@keyframes crescentSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--gold);
}



/* ---------- RTL Specific Tweaks ---------- */
[dir="rtl"] .header-left {
  flex-direction: row-reverse;
}
[dir="rtl"] .header-logo {
  align-items: flex-end;
}
[dir="rtl"] .section-header-left {
  flex-direction: row-reverse;
}
[dir="rtl"] .input-label {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
[dir="rtl"] .nisab-info {
  flex-direction: row-reverse;
}
[dir="rtl"] .action-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .summary-grid {
  direction: rtl;
}
[dir="rtl"] .footer-quran {
  direction: rtl;
}
[dir="rtl"] .options-bar {
  flex-direction: row-reverse;
}
[dir="rtl"] .option-group {
  flex-direction: row-reverse;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2), 0 0 30px rgba(212, 175, 55, 0.3);
  overflow: hidden;
  border: 1px solid var(--gold);
}

.modal-header {
  background: var(--white);
  color: var(--gold);
  padding: 18px 20px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
}

.modal-close:hover { opacity: 1; }

.modal-body {
  padding: 24px 20px;
}

.bank-card {
  background: rgba(11, 61, 46, 0.03);
  border: 1px dashed var(--gold);
  padding: 16px;
  border-radius: 12px;
}

.bank-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.bank-row:last-child { margin-bottom: 0; }

.bank-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.bank-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

[data-theme="dark"] .bank-card {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .bank-value {
  color: var(--gold);
}

.support-btn {
  background: rgba(212, 175, 55, 0.1) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
}

.support-btn svg {
  color: var(--gold);
}

@media (max-width: 480px) {
  .modal-content {
    border-radius: 18px;
    max-width: calc(100% - 32px);
  }
}

/* ---------- Footer Bank Details ---------- */
.footer-bank-details {
  margin: 24px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-bank-details h4 {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.footer-bank-card {
  width: 100%;
  max-width: 450px;
  background: rgba(212, 175, 55, 0.03);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  text-align: left;
}

[data-theme="dark"] .footer-bank-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(212, 175, 55, 0.2);
}

.upi-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--white);
  color: var(--gold-dark);
  border: 1.5px solid var(--gold);
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 16px;
  transition: var(--transition);
  cursor: pointer;
}

.upi-pay-btn:hover {
  background: var(--gold);
  color: var(--white);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.upi-pay-btn svg {
  color: inherit;
}

[data-theme="dark"] .upi-pay-btn {
  background: transparent;
}

.upi-qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  background: var(--white);
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--gold);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.upi-qr-code {
  width: 140px;
  height: 140px;
  display: block;
}

[data-theme="dark"] .upi-qr-container {
  background: white; /* Keep background white for QR readability */
  border-color: var(--gold);
}

.payment-methods {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding: 10px;
  background: rgba(212, 175, 55, 0.03);
  border-radius: 12px;
}

.pay-logo {
  height: 18px;
  width: auto;
  opacity: 0.8;
  filter: grayscale(0.2);
  transition: var(--transition);
}

.pay-logo:hover {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.05);
}

[data-theme="dark"] .payment-methods {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .pay-logo {
  filter: brightness(0) invert(1) opacity(0.7); /* Make them white-ish in dark mode for premium look */
}

[data-theme="dark"] .pay-logo:hover {
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .app-name {
    font-size: 1.1rem;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .summary-value {
    font-size: 0.85rem;
  }
  .section-inner {
    padding: 0 16px 16px;
  }
}

@media (min-width: 768px) {
  .main-content {
    padding: 20px 24px;
  }
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .input-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .hero-section {
    padding: 40px 20px 56px;
  }
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 110px;
  }
  .main-content {
    padding: 24px 32px;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .app-header,
  .summary-panel,
  .action-row,
  .hero-section,
  .options-bar,
  .page-loader,
  .install-banner,
  body::before {
    display: none !important;
  }
  body {
    padding: 0;
    background: white;
  }
  .calc-section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  .section-body {
    max-height: none !important;
    opacity: 1 !important;
  }
}
