/*
 * User Upgrade - Unified Settings Center Style
 * ISSUE_7214: Replaced StratCraft cinematic design with clean/minimal global tokens
 */

/* ============================================
   DATA-THEME BRIDGE (per ISSUE_7050)
   Body/HTML background now handled by account-theme-tokens.css
   ============================================ */

/* Layout resets for standalone upgrade page */
html:has(.upgrade-page-wrapper) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
body:has(.upgrade-page-wrapper) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Force Transparency on WordPress Containers when upgrade page is active */
body:has(.upgrade-page-wrapper) .site,
body:has(.upgrade-page-wrapper) .site-content,
body:has(.upgrade-page-wrapper) .entry-content,
body:has(.upgrade-page-wrapper) .site-container,
body:has(.upgrade-page-wrapper) #page {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ============================================
   ISSUE_7410: Alias --up-* to centralized --act-* tokens
   Dark/light switching handled by account-theme-tokens.css
   ============================================ */

.upgrade-page-wrapper {
  --up-bg: var(--act-bg-surface);
  --up-card-bg: var(--act-bg);
  --up-card-border: var(--act-border);
  --up-text-primary: var(--act-text-primary);
  --up-text-secondary: var(--act-text-secondary);
  --up-text-muted: var(--act-text-muted);
  --up-btn-bg: var(--act-btn-primary-bg);
  --up-btn-text: var(--act-btn-primary-text);
  --up-btn-hover-bg: var(--act-btn-primary-hover);
  --up-shadow-card: var(--act-shadow-card);
  --up-radius-card: 12px;
  --up-radius-btn: 8px;
  --up-success: var(--act-success);
  --up-success-bg: var(--act-badge-active-bg);
  --up-border-light: var(--act-border-light);
}

/* ============================================
   HIDE CANVAS + GRADIENT OVERLAYS
   ============================================ */

/* Stratcraft canvas - visible in both themes */
#silver-stream-canvas {
  display: block !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.upgrade-page-wrapper::before {
  content: none;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */

.upgrade-page-wrapper {
  background-color: var(--up-bg);
  color: var(--up-text-primary);
  font-family: var(--font-system, -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* Content Container */
.upgrade-page-wrapper .upgrade-container {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.upgrade-page-wrapper .page-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.1;
  color: var(--up-text-primary);
  /* No gradient text */
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
}

.upgrade-page-wrapper[data-theme="light"] .page-title {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
}

.upgrade-page-wrapper .page-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--up-text-secondary);
  margin-bottom: 3rem;
}

/* ============================================
   PRICING GRID
   ============================================ */

.upgrade-page-wrapper .pricing-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* ============================================
   CARDS - Solid, no glassmorphism
   ============================================ */

.pricing-plan-card {
  background: var(--up-card-bg);
  border: 1px solid var(--up-card-border);
  border-radius: var(--up-radius-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--up-shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  /* No backdrop-filter */
}

.pricing-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Popular Card Highlight */
.pricing-plan-card.popular {
  border-color: var(--up-text-secondary);
}

/* Card Header */
.plan-header {
  margin-bottom: 24px;
}

.plan-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--up-text-primary);
  margin: 0 0 12px 0;
}

/* ============================================
   BILLING TOGGLE - Light bordered pill
   ============================================ */

.card-billing-control {
  background: rgba(128, 128, 128, 0.1);
  border-radius: 99px;
  padding: 4px;
  display: inline-flex;
  border: 1px solid var(--up-card-border);
}

.billing-option {
  background: transparent;
  border: none;
  border-radius: 99px;
  padding: 6px 12px;
  color: var(--up-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.billing-option.active {
  background: var(--up-card-bg);
  color: var(--up-text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Free Badge */
.free-badge {
  background: var(--up-success-bg);
  color: var(--up-success);
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

/* ============================================
   PRICING
   ============================================ */

.plan-price-wrapper {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--up-card-border);
}

.plan-price {
  display: flex;
  align-items: baseline;
  color: var(--up-text-primary);
}

.price-amount {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.price-period {
  color: var(--up-text-secondary);
  margin-left: 6px;
  font-size: 1rem;
}

.billed-monthly-text, .billed-yearly-text {
  font-size: 0.9rem;
  color: var(--up-text-muted);
  margin-top: 4px;
}

.billed-yearly-text { display: none; }
.annual-view .billed-monthly-text { display: none; }
.annual-view .billed-yearly-text { display: block; }

.save-yearly-text {
  font-size: 0.9rem;
  color: var(--up-success);
  font-weight: 600;
  margin-top: 2px;
  display: none;
}
.annual-view .save-yearly-text { display: block; }

/* ============================================
   FEATURES LIST - Green checkmarks
   ============================================ */

.upgrade-page-wrapper .plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  flex-grow: 1;
}

.upgrade-page-wrapper .feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--up-text-secondary);
  font-size: 0.9rem;
}

.upgrade-page-wrapper .feature-item::before {
  content: '\2713';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--up-success-bg);
  color: var(--up-success);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  margin-right: 10px;
  flex-shrink: 0;
}

.upgrade-page-wrapper .feature-item.excluded {
  opacity: 0.5;
}

.upgrade-page-wrapper .feature-item.excluded::before {
  content: '\00d7';
  background: rgba(128, 128, 128, 0.1);
  color: var(--up-text-muted);
}

/* Locked items - available in higher tiers */
.upgrade-page-wrapper .feature-item.locked {
  opacity: 0.35;
  color: var(--up-text-muted);
}

.upgrade-page-wrapper .feature-item.locked::before {
  content: '\2013';
  background: transparent;
  color: var(--up-text-muted);
  border: 1px solid rgba(128, 128, 128, 0.3);
  font-size: 13px;
  font-weight: normal;
  width: 18px;
  height: 18px;
}

/* Feature category section headers within the list */
.upgrade-page-wrapper .plan-features .feature-category {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--up-text-muted);
  opacity: 0.65;
  margin-top: 18px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--up-border-light);
}

.upgrade-page-wrapper .plan-features .feature-category:first-child {
  margin-top: 0;
}

.upgrade-page-wrapper .plan-features .feature-category::before {
  display: none;
}

/* ============================================
   BUTTONS - Solid fill, no gradient/glow
   ============================================ */

.plan-cta, .cta-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--up-radius-btn);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--up-btn-bg);
  color: var(--up-btn-text);
  border: none;
  box-shadow: none;
}

.plan-cta:hover {
  background: var(--up-btn-hover-bg);
  transform: translateY(-1px);
}

/* Current Plan / Disabled */
.plan-cta.current {
  background: rgba(128, 128, 128, 0.15);
  color: var(--up-text-muted);
  border: 1px solid var(--up-card-border);
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary Actions */
.plan-cta.secondary {
  background: transparent;
  border: 1px solid var(--up-card-border);
  color: var(--up-text-primary);
  box-shadow: none;
}

.plan-cta.secondary:hover {
  background: rgba(128, 128, 128, 0.1);
  border-color: var(--up-text-secondary);
}

/* ============================================
   CURRENT PLAN BADGE
   ============================================ */

.current-plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--up-success-bg);
  color: var(--up-success);
  border: 1px solid rgba(40, 167, 69, 0.4);
  margin-left: 10px;
  vertical-align: middle;
  -webkit-text-fill-color: var(--up-success);
  white-space: nowrap;
}

/* ============================================
   CURRENT PLAN CARD - Green border + top bar, no glow
   ============================================ */

.pricing-plan-card.is-current-plan {
  border-color: rgba(40, 167, 69, 0.5);
  border-width: 2px;
  box-shadow: var(--up-shadow-card);
}

.pricing-plan-card.is-current-plan::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--up-success);
  border-radius: var(--up-radius-card) var(--up-radius-card) 0 0;
}

/* ISSUE_7280: Push footer to bottom of card so buttons align across cards */
.pricing-plan-card .plan-footer {
  margin-top: auto;
}

/* ISSUE_7280: Scheduled date uses height:0 + overflow:visible so it doesn't push sibling buttons */
.downgrade-scheduled-date {
  font-size: 0.75rem;
  color: var(--up-text-muted);
  margin-top: 6px;
  text-align: center;
  height: 0;
  overflow: visible;
}

/* ============================================
   LEGAL TEXT
   ============================================ */

.legal-disclaimer {
  text-align: center;
  margin-top: 40px;
  color: var(--up-text-muted);
  font-size: 0.85rem;
}

.refund-policy-link {
  background: none;
  border: none;
  color: var(--up-text-secondary);
  font-size: 0.9rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.8;
}

.refund-policy-link:hover {
  color: var(--up-text-primary);
  opacity: 1;
}

/* ============================================
   MODALS - Solid background, no blur
   ============================================ */

.upgrade-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}

.upgrade-modal-overlay.active { display: flex; }

.upgrade-modal {
  background: var(--up-card-bg);
  border: 1px solid var(--up-card-border);
  border-radius: var(--up-radius-card);
  padding: 32px;
  max-width: 1100px;
  width: 90%;
  max-height: 80vh;
  margin: 5vh auto;
  overflow-y: auto;
  color: var(--up-text-primary);
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-title { font-size: 1.5rem; color: var(--up-text-primary); margin-bottom: 20px; }
.modal-section-title { font-size: 1.1rem; color: var(--up-text-primary); margin-bottom: 8px; font-weight: 600; }
.modal-text { font-size: 0.95rem; color: var(--up-text-secondary); line-height: 1.6; }
.modal-close-btn {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 24px; color: var(--up-text-secondary); cursor: pointer;
}

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

@media (max-width: 900px) {
  .upgrade-page-wrapper .pricing-container {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* ============================================
   HYBRID HEADER - Solid background, no glassmorphism
   ============================================ */

/* Adjust main content starting position (accounts for fixed standalone-header 64px + ribbon 4px) */
.upgrade-container {
  padding-top: 100px;
}

/* ============================================
   HIDE DEFAULT THEME ELEMENTS
   ============================================ */

body:has(.upgrade-page-wrapper) #wpadminbar,
body:has(.upgrade-page-wrapper) .site-info,
body:has(.upgrade-page-wrapper) .site-footer,
body:has(.upgrade-page-wrapper) .site-header,
body:has(.upgrade-page-wrapper) #site-header,
body:has(.upgrade-page-wrapper) #masthead,
body:has(.upgrade-page-wrapper) .top-bar,
body:has(.upgrade-page-wrapper) .header-wrap,
body:has(.upgrade-page-wrapper) .site-branding-container,
body:has(.upgrade-page-wrapper) .strategy-header-wrapper {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ============================================
   MILITARY RIBBON (ISSUE_7050 / ISSUE_7989 design standard)
   ============================================ */
.upgrade-page-ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 10001;
  background: linear-gradient(90deg,
    #16a34a 0%, #16a34a 22%,
    #eab308 22%, #eab308 44%,
    #dc2626 44%, #dc2626 66%,
    #3b82f6 66%, #3b82f6 88%,
    #008F60 88%
  );
}

/* Offset standalone-header below ribbon (ribbon is 4px fixed at top:0) */
.upgrade-page-wrapper .standalone-header--fixed {
  top: 4px;
}
