/* ============================================================
   plans.css — Premium Subscription Plan UI
   Upgrade Modal, Pricing Cards, Account Menu
   ============================================================ */

/* ────────── UPGRADE MODAL ────────── */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base) var(--ease-out);
}

.upgrade-modal.visible {
  opacity: 1;
  visibility: visible;
}

.upgrade-backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim-heavy);
  cursor: pointer;
}

.upgrade-panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  
  background: var(--glass-strong);
  
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  
  padding: var(--s8) var(--s6);
  
  box-shadow: var(--shadow-2xl),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  
  transform: scale(0.9) translateY(20px);
  transition: transform var(--t-base) var(--ease-spring);
}

.upgrade-modal.visible .upgrade-panel {
  transform: scale(1) translateY(0);
}

/* Close button */
.upgrade-close {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  box-shadow: none;
}

.upgrade-close::before {
  display: none;
}

.upgrade-close:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  transform: rotate(90deg) scale(1.05);
}

/* Header */
.upgrade-header {
  text-align: center;
  margin-bottom: var(--s7);
}

.upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  margin-bottom: var(--s4);
  
  background: var(--gold-wash);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-full);
  
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  
  box-shadow: 0 0 24px var(--gold-glow);
}

.upgrade-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 40px);
  font-weight: var(--fw-heavy);
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--s3);
  letter-spacing: -0.02em;
  
  background: linear-gradient(135deg, var(--text-primary), var(--gold-light) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.upgrade-trigger {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  padding: var(--s2) var(--s4);
  background: var(--danger-wash);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-md);
  display: inline-block;
  margin-top: var(--s3);
}

.upgrade-trigger b {
  color: var(--danger);
  font-weight: var(--fw-bold);
}

/* Plans grid */
.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
  margin-bottom: var(--s6);
}

@media (min-width: 640px) {
  .upgrade-plans {
    grid-template-columns: 1fr 1fr;
  }
}

/* ────────── PLAN CARDS ────────── */
.plan-card {
  position: relative;
  padding: var(--s7) var(--s6) var(--s6);
  
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--r-xl);
  
  transition: all var(--t-base) var(--ease-out);
}

.plan-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Pro plan card - premium styling */
.plan-card.plan-pro {
  background: linear-gradient(135deg, var(--gold-wash) 0%, transparent 100%);
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px var(--border-gold),
              0 0 48px var(--gold-glow),
              var(--shadow-lg);
}

.plan-card.plan-pro:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 0 2px var(--gold),
              0 0 64px var(--gold-glow),
              var(--shadow-2xl);
}

/* Ribbon */
.plan-ribbon {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  padding: var(--s1) var(--s3);
  
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  
  border-radius: var(--r-full);
  
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-heavy);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  
  box-shadow: var(--shadow-md), 0 0 16px var(--gold-glow);
  
  animation: ribbonPulse 2s ease-in-out infinite;
}

@keyframes ribbonPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Plan header */
.plan-header {
  margin-bottom: var(--s6);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--border-subtle);
}

.plan-header h3 {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--s2);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.price-amount {
  font-family: var(--font-display);
  font-size: var(--fs-mega);
  font-weight: var(--fw-heavy);
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.plan-pro .price-amount {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-period {
  font-size: var(--fs-body);
  color: var(--text-tertiary);
  font-weight: var(--fw-medium);
}

.plan-tagline {
  font-size: var(--fs-small);
  color: var(--gold);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Plan features */
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s6) 0;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) 0;
  font-size: var(--fs-body);
  color: var(--text-primary);
  line-height: 1.5;
}

.plan-features li .ico {
  flex-shrink: 0;
  color: var(--emerald);
  background: var(--emerald-wash);
  border-radius: var(--r-full);
  padding: 3px;
  width: 22px;
  height: 22px;
}

.plan-features li b {
  color: var(--gold);
  font-weight: var(--fw-bold);
}

/* Disabled features */
.plan-features li.feature-disabled {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.plan-features li.feature-disabled .ico {
  color: var(--danger);
  background: var(--danger-wash);
}

/* Current plan badge */
.plan-badge-current {
  position: absolute;
  top: var(--s4);
  left: var(--s4);
  padding: var(--s1) var(--s3);
  
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.plan-pro .plan-badge-current {
  background: var(--gold);
  color: var(--bg-base);
  border-color: transparent;
}

/* Upgrade button */
.plan-upgrade {
  width: 100%;
  padding: var(--s5) var(--s6);
  
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  
  border: 0;
  border-radius: var(--r-md);
  
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  
  cursor: pointer;
  
  box-shadow: var(--shadow-md), 0 0 32px var(--gold-glow);
  
  transition: all var(--t-fast) var(--ease-out);
  
  position: relative;
  overflow: hidden;
}

.plan-upgrade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: sheenBtn 3s ease-in-out infinite;
}

@keyframes sheenBtn {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

.plan-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 48px var(--gold-glow);
}

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

.plan-cancel {
  width: 100%;
  margin-top: var(--s3);
}

/* Guarantee text */
.upgrade-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-small);
  padding: var(--s4);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--s5);
}

.upgrade-guarantee .ico {
  color: var(--emerald);
}

/* ────────── ACCOUNT MENU ────────── */
.account-menu {
  position: fixed;
  top: 80px;
  right: var(--s4);
  z-index: var(--z-dropdown);
  
  width: 320px;
  
  background: var(--glass-strong);
  
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  
  padding: var(--s5);
  
  box-shadow: var(--shadow-2xl);
  
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  transition: all var(--t-base) var(--ease-spring);
  
  transform-origin: top right;
}

.account-menu.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.account-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s4);
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--border-subtle);
}

.account-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  
  border-radius: var(--r-full);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: var(--fw-heavy);
  
  box-shadow: var(--shadow-md), 0 0 16px var(--gold-glow);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-email {
  font-size: var(--fs-small);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  word-break: break-all;
  line-height: 1.3;
  margin-bottom: 4px;
}

.account-plan {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-plan.plan-free {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.account-plan.plan-pro {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Usage stats */
.account-usage {
  padding: var(--s3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-bottom: var(--s4);
}

.usage-title {
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s2);
}

.usage-item {
  display: flex;
  justify-content: space-between;
  padding: var(--s1) 0;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.usage-count {
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

/* Account actions */
.account-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.account-actions button {
  width: 100%;
  padding: var(--s3) var(--s4);
  font-size: var(--fs-small);
  min-height: 44px;
}

.account-upgrade {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  border: 0;
  box-shadow: var(--shadow-md), 0 0 16px var(--gold-glow);
  font-weight: var(--fw-bold);
}

.account-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), 0 0 24px var(--gold-glow);
}

/* ────────── AD SLOT STYLING ────────── */
#adslot {
  background: var(--glass-medium);
  
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 0;
  margin-bottom: var(--s5);
  overflow: hidden;
  
  transition: all var(--t-base) var(--ease-out);
}

#adslot:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 24px var(--gold-glow);
}

.ad-content {
  position: relative;
}

.ad-label {
  padding: 4px 12px;
  background: var(--bg-base);
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.ad-inner {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
}

.ad-text {
  flex: 1;
  min-width: 0;
}

.ad-text b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ad-text span {
  display: block;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.ad-inner button {
  flex-shrink: 0;
  width: auto;
  padding: var(--s2) var(--s4);
  min-height: 40px;
  font-size: var(--fs-small);
}

/* ────────── PLAN BADGE IN HEADER ────────── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan-badge.plan-free {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.plan-badge.plan-pro {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-base);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* ────────── USAGE INDICATORS ────────── */
.usage-full {
  color: var(--danger) !important;
  font-weight: var(--fw-bold);
}

.usage-ok {
  color: var(--emerald);
}

/* ────────── MESSAGES ────────── */
.msg-success {
  color: var(--emerald) !important;
}

.msg-error {
  color: var(--danger) !important;
}

.msg-info {
  color: var(--text-secondary) !important;
}

/* ────────── FORGOT PASSWORD LINK ────────── */
.forgot-link {
  display: block;
  text-align: right;
  margin-top: var(--s2);
  font-size: var(--fs-small);
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  border: 0;
  width: auto;
  min-height: auto;
  padding: var(--s1) 0;
  box-shadow: none;
  font-weight: var(--fw-medium);
}

.forgot-link::before {
  display: none;
}

.forgot-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
  box-shadow: none;
}

/* ────────── RESPONSIVE ────────── */
@media (max-width: 640px) {
  .upgrade-panel {
    padding: var(--s6) var(--s4);
    max-height: 95vh;
  }
  
  .price-amount {
    font-size: var(--fs-hero);
  }
  
  .account-menu {
    right: var(--s3);
    left: var(--s3);
    width: auto;
  }
}
