/* ============================================
   Astra — Subscription / Pricing Panel
   pricing.css
   ============================================ */

/* ── Keyframes ──────────────────────────────── */

@keyframes zodiacDrift {
  0%   { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-18px) rotate(8deg); }
}

@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes moonPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.12); opacity: 1; }
}

@keyframes pricingModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pricingModalOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.96) translateY(16px); }
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes starSpin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-4px) scale(1.05); }
}

@keyframes neptuneOrbit {
  0%   { transform: rotate(0deg) translateX(4px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(4px) rotate(-360deg); }
}

@keyframes ctaPulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,151,58,0); }
  50%       { box-shadow: 0 0 0 8px rgba(196,151,58,0.2); }
}

@keyframes ctaPulsePurple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,92,191,0); }
  50%       { box-shadow: 0 0 0 8px rgba(124,92,191,0.2); }
}

@keyframes ftRowFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

/* ── Light Theme Gradients ──────────────────── */
[data-theme="light"] .pricing-panel {
  background: linear-gradient(135deg, #fff8f0 0%, #fdf3e3 40%, #fef5d4 100%);
}

/* ── Dark Theme Gradients ───────────────────── */
[data-theme="dark"] .pricing-panel {
  background: linear-gradient(160deg, #0a1020 0%, #111827 50%, #0d1833 100%);
}

/* ── Modal Overlay ──────────────────────────── */
.pricing-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  animation: overlayFadeIn 0.25s ease forwards;
  overflow-y: auto;
}

.pricing-modal-overlay.pricing-modal--open .pricing-panel {
  animation: pricingModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pricing-modal-overlay.pricing-modal--closing .pricing-panel {
  animation: pricingModalOut 0.3s ease forwards;
}

/* ── Panel ──────────────────────────────────── */
.pricing-panel {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  padding: 40px 36px 48px;
  overflow-y: auto;
  max-height: calc(100vh - 32px);
}

/* Light panel border */
[data-theme="light"] .pricing-panel {
  border-color: rgba(196, 151, 58, 0.2);
  box-shadow: 0 24px 80px rgba(61,43,31,0.15), 0 0 0 1px rgba(196,151,58,0.15);
}

/* ── Close Button ───────────────────────────── */
.pricing-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 10;
}

.pricing-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: scale(1.1) rotate(90deg);
}

/* ── Header ─────────────────────────────────── */
.pricing-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.pricing-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.pricing-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

/* ── Cycle Toggle ───────────────────────────── */
.cycle-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 4px;
  width: fit-content;
  margin: 0 auto 32px;
  position: relative;
  z-index: 2;
}

.cycle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: var(--accent-gradient);
  border-radius: 40px;
  transition: left 0.3s cubic-bezier(0.34,1.56,0.64,1), width 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 0;
  box-shadow: 0 2px 8px rgba(196,151,58,0.25);
}

.cycle-btn {
  padding: 9px 18px;
  border-radius: 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cycle-btn.active {
  color: white;
  font-weight: 600;
}

.cycle-badge {
  font-size: 10px;
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.cycle-btn.active .cycle-badge {
  background: rgba(255,255,255,0.25);
}

/* ── Plans Grid ─────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

@media (max-width: 700px) {
  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Plan Card ──────────────────────────────── */
.plan-card {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  overflow: visible;
}

.plan-card:hover {
  transform: translateY(-4px);
}

.plan-card--pro {
  border-color: rgba(196, 151, 58, 0.4);
  transform: scale(1.02);
  z-index: 1;
}

.plan-card--pro:hover {
  transform: scale(1.02) translateY(-4px);
}

.plan-card--elite {
  border-color: rgba(124, 92, 191, 0.35);
}

/* Glow ring */
.plan-card-glow {
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.plan-card--basic:hover .plan-card-glow {
  background: radial-gradient(ellipse at center, rgba(107,143,163,0.15), transparent 70%);
  opacity: 1;
}

.plan-card--pro .plan-card-glow {
  background: radial-gradient(ellipse at center, rgba(196,151,58,0.2), transparent 70%);
  opacity: 0.6;
  animation: ctaPulseGold 3s ease-in-out infinite;
}

.plan-card--pro:hover .plan-card-glow {
  opacity: 1;
}

.plan-card--elite:hover .plan-card-glow {
  background: radial-gradient(ellipse at center, rgba(124,92,191,0.2), transparent 70%);
  opacity: 1;
}

.plan-card-inner {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px 20px 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .plan-card--pro .plan-card-inner {
  background: linear-gradient(160deg, #1e2d1a 0%, #1e293b 100%);
}

[data-theme="dark"] .plan-card--elite .plan-card-inner {
  background: linear-gradient(160deg, #1a1530 0%, #1e293b 100%);
}

[data-theme="light"] .plan-card--pro .plan-card-inner {
  background: linear-gradient(160deg, #fffbf0 0%, #fff8e8 100%);
}

[data-theme="light"] .plan-card--elite .plan-card-inner {
  background: linear-gradient(160deg, #f8f5ff 0%, #f5f0ff 100%);
}

/* ── Plan Badge ─────────────────────────────── */
.plan-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.plan-badge--pro {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(196,151,58,0.3);
}

.plan-badge--elite {
  background: linear-gradient(135deg, #7c5cbf, #a07de0);
  color: white;
  box-shadow: 0 2px 8px rgba(124,92,191,0.3);
}

/* ── Plan Icon ──────────────────────────────── */
.plan-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.plan-icon-wrap--basic { background: radial-gradient(circle, rgba(107,143,163,0.2), transparent); }
.plan-icon-wrap--pro   { background: radial-gradient(circle, rgba(196,151,58,0.2), transparent); }
.plan-icon-wrap--elite { background: radial-gradient(circle, rgba(124,92,191,0.2), transparent); }

.plan-icon {
  font-size: 28px;
  display: block;
  line-height: 1;
}

.plan-icon-anim--moonFloat { animation: moonFloat 3s ease-in-out infinite; }
.plan-icon-anim--starSpin  { animation: starSpin 6s linear infinite; color: #c4973a; }
.plan-icon-anim--neptuneOrbit { animation: neptuneOrbit 5s linear infinite; color: #7c5cbf; }

.plan-icon-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.plan-card:hover .plan-icon-ring {
  border-color: var(--accent);
  opacity: 0.4;
}

.plan-card--elite:hover .plan-icon-ring {
  border-color: #7c5cbf;
}

/* ── Plan Name ──────────────────────────────── */
.plan-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* ── Plan Pricing ───────────────────────────── */
.plan-pricing {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.plan-price-main {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.plan-card--pro .plan-price-main   { color: #c4973a; }
.plan-card--elite .plan-price-main { color: #7c5cbf; }

.plan-price-cycle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-savings-badge {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border-radius: 20px;
  border: 1px solid rgba(34,197,94,0.2);
}

/* ── Feature List ───────────────────────────── */
.plan-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.plan-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
}

.plan-feature-item.excluded {
  color: var(--text-muted);
  opacity: 0.55;
}

.feat-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.plan-feature-item.included .feat-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.plan-feature-item.excluded .feat-icon {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.feat-text {
  flex: 1;
  line-height: 1.3;
}

/* Tooltip */
.feat-tooltip-trigger {
  position: relative;
  color: var(--text-muted);
  font-size: 11px;
  cursor: help;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.feat-tooltip-trigger:hover {
  opacity: 1;
}

.feat-tooltip {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
  max-width: 200px;
  white-space: normal;
  text-align: left;
  line-height: 1.4;
  min-width: 120px;
}

.feat-tooltip-trigger:hover .feat-tooltip {
  display: block;
}

/* ── CTA Button ─────────────────────────────── */
.plan-cta {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.plan-cta-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 12px;
  pointer-events: none;
}

.plan-cta:not(:disabled):hover .plan-cta-glow {
  opacity: 1;
}

/* Basic */
.plan-cta--basic {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.plan-cta--basic:disabled {
  cursor: default;
  opacity: 0.7;
}

/* Pro */
.plan-cta--pro {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(196,151,58,0.3);
  animation: ctaPulseGold 3s ease-in-out infinite;
}

.plan-cta--pro .plan-cta-glow {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15), transparent 70%);
}

[data-theme="light"] .plan-cta--pro {
  box-shadow: 0 4px 16px rgba(196,151,58,0.4);
}

/* Elite */
.plan-cta--elite {
  background: linear-gradient(135deg, #7c5cbf, #a07de0);
  color: white;
  box-shadow: 0 4px 16px rgba(124,92,191,0.3);
  animation: ctaPulsePurple 3s ease-in-out infinite;
}

.plan-cta--elite .plan-cta-glow {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15), transparent 70%);
}

.plan-cta:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.plan-cta:active {
  transform: translateY(0);
}

/* Loading state */
.plan-cta--loading .plan-cta-text::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: white;
  border-radius: 50%;
  animation: spinLoader 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* ── Feature Table ──────────────────────────── */
.feature-table-wrap {
  position: relative;
  z-index: 2;
  margin-bottom: 32px;
}

.feature-table-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

.feature-table-scroll {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.feature-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 13px;
}

.feature-table th {
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.ft-col-label {
  text-align: left !important;
  padding-left: 20px !important;
}

.ft-col-pro { color: #c4973a !important; }
.ft-col-elite { color: #7c5cbf !important; }

.ft-row {
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transition: background 0.15s;
}

.ft-row:last-child { border-bottom: none; }

.ft-row:hover { background: var(--bg-hover); }

.ft-row.ft-row--visible {
  animation: ftRowFadeIn 0.4s ease forwards;
}

.ft-feature-name {
  padding: 11px 16px 11px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.ft-cell {
  text-align: center;
  padding: 11px 16px;
}

.ft-check--yes {
  display: inline-flex;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.ft-check--no {
  color: var(--text-muted);
  font-size: 16px;
  opacity: 0.4;
}

.ft-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Trust Section ──────────────────────────── */
.trust-section {
  position: relative;
  z-index: 2;
  margin-top: 4px;
}

.trust-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0;
  animation: trustFadeIn 0.5s ease forwards;
}

.trust-icon {
  font-size: 15px;
  opacity: 0.7;
}

/* ── Toast ──────────────────────────────────── */
.pricing-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
}

.pricing-toast--success {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.08);
}

.pricing-toast--error {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
  color: #ef4444;
}

.pricing-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Upgrade Button in Sidebar ──────────────── */
.upgrade-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% - 40px);
  margin: 0 20px 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(196,151,58,0.25);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.upgrade-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.upgrade-btn:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(196,151,58,0.3);
  transform: translateY(-1px);
}

.upgrade-btn span {
  position: relative;
  z-index: 1;
}

.upgrade-btn-star {
  font-size: 16px;
  animation: starSpin 4s linear infinite;
  position: relative;
  z-index: 1;
}

/* ── Settings Upgrade Button ────────────────── */
.settings-upgrade-btn {
  background: var(--accent-gradient) !important;
  color: white !important;
  border: none !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(196,151,58,0.25) !important;
}

.settings-upgrade-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(196,151,58,0.4) !important;
}
@media (max-width: 768px) {
  .pricing-panel {
    padding: 28px 20px 36px;
    border-radius: 20px;
    max-height: 90vh;
  }

  .pricing-title { font-size: 22px; }

  .cycle-toggle {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 6px;
  }

  .cycle-btn { padding: 8px 14px; font-size: 12px; }

  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
  }

  .plan-card--pro { transform: none; }
  .plan-card--pro:hover { transform: translateY(-4px); }

  .trust-grid { gap: 10px 16px; }
}

@media (max-width: 480px) {
  .pricing-modal-overlay { padding: 0; align-items: flex-end; }
  .pricing-panel {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    padding: 24px 16px 32px;
  }
}
