/* Modern <dialog> and Modal Transitions per Modern Web Standards */

dialog {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-width: 680px;
  width: 92%;
  margin: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.15);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), overlay 0.25s allow-discrete, display 0.25s allow-discrete;
  opacity: 0;
  transform: scale(0.95) translateY(12px);
}

dialog[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
}

dialog::backdrop {
  background: rgba(4, 6, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.25s ease, overlay 0.25s allow-discrete, display 0.25s allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
  }
}

/* Modal Inner Container */
.modal-wrapper {
  background: linear-gradient(180deg, #101535 0%, #090c21 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.modal-timeframe {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.modal-title {
  font-size: 1.5rem;
  color: #fff;
  line-height: 1.3;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
}

.modal-meta-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.modal-meta-item strong {
  font-size: 0.95rem;
  color: var(--gold-light);
}

.modal-body-section {
  margin-bottom: 24px;
}

.modal-body-section h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Paywall / Remedy Unlock Box */
.remedy-unlock-card {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.15) 0%, rgba(15, 20, 48, 0.9) 75%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-top: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(245, 158, 11, 0.15);
}

.remedy-lock-icon {
  font-size: 2.2rem;
  color: var(--gold-light);
  margin-bottom: 10px;
}

.remedy-unlock-card h3 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 8px;
}

.remedy-unlock-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.remedy-price-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--gold-primary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.remedy-price-badge .currency {
  font-size: 0.9rem;
  color: var(--gold-light);
  font-weight: 600;
}

.remedy-price-badge .amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-serif);
}

.remedy-price-badge .period {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Revealed Vedic Remedies Sections */
.remedies-revealed {
  margin-top: 28px;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  padding-top: 24px;
}

.remedies-revealed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.remedies-revealed-header h3 {
  color: var(--gold-light);
  font-size: 1.25rem;
}

.remedy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.remedy-box {
  background: rgba(6, 8, 19, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.remedy-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.remedy-box-content {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.mantra-sanskrit {
  font-size: 1.15rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--gold-primary);
  padding: 10px 14px;
  border-radius: 4px;
  margin: 8px 0;
  font-family: 'Cinzel', serif;
}

.remedy-bullets {
  padding-left: 20px;
  margin-top: 8px;
}

.remedy-bullets li {
  margin-bottom: 6px;
}

/* Spinner & Success Banner */
.cosmic-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: cosmic-spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes cosmic-spin {
  to { transform: rotate(360deg); }
}

.unlock-success-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

/* Mobile Responsive Overhaul for Dialogs & Modals */
@media (max-width: 640px) {
  dialog {
    width: 95%;
    max-width: 95%;
  }

  .modal-wrapper {
    padding: 20px 16px;
    border-radius: var(--radius-md);
    max-height: 90dvh;
  }

  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .mantra-sanskrit {
    font-size: 0.98rem;
    padding: 8px 10px;
  }

  .remedy-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

