/* ==========================================================================
   PORTAL STORE — DEEP BLACK OLED / MINIMALIST iOS STYLE
   ========================================================================== */

:root {
  --bg-black: #000000;
  --bg-card: rgba(17, 17, 20, 0.88);
  --bg-card-solid: #111114;
  --bg-elevated: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.2);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;

  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-green: #22c55e;
  --accent-red: #ef4444;

  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 9999px;
  --transition: 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-black);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  line-height: 1.5;
}

/* Ambient Background */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(130px);
  z-index: 0;
}

.ambient-glow-1 {
  width: 460px;
  height: 460px;
  top: -140px;
  left: 50%;
  transform: translateX(-60%);
  background: rgba(59, 130, 246, 0.14);
}

.ambient-glow-2 {
  width: 380px;
  height: 380px;
  bottom: -120px;
  right: 12%;
  background: rgba(255, 255, 255, 0.06);
}

/* Main Centered Layout */
.store-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
}

.store-shell {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transition: transform var(--transition);
}

/* Brand */
.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.store-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
}

.store-brand-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Lookup Card */
.lookup-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.lookup-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.lookup-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.username-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.username-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 18px;
  transition: border-color var(--transition), background var(--transition);
}

.username-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.username-prefix {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-tertiary);
  user-select: none;
}

.username-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
}

.username-input::placeholder {
  color: var(--text-tertiary);
}

.lookup-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.lookup-submit-btn:hover:not(:disabled) {
  transform: scale(1.02);
}

.lookup-submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.lookup-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lookup-error {
  font-size: 13px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 9px 14px;
}

/* Found User Badge */
.user-badge {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  animation: fadeSlideUp 0.28s ease-out;
}

.user-badge-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27272a, #3f3f46);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  min-width: 0;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-display-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.user-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.dot-sep {
  color: var(--text-tertiary);
}

.user-sparks-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fde68a;
}

.change-user-btn {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.change-user-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Store Content & Tabs */
.store-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.store-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(20px);
}

.store-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
}

.store-tab:hover {
  color: var(--text-primary);
}

.store-tab.is-active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.14);
}

.tab-panel {
  width: 100%;
}

/* Premium Benefits Card */
.premium-benefits-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  backdrop-filter: blur(20px);
}

.benefits-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.benefits-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.benefits-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.benefits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.benefits-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.benefits-list iconify-icon {
  color: #93c5fd;
  flex-shrink: 0;
}

/* Premium Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  backdrop-filter: blur(20px);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.plan-card.is-featured {
  border-color: rgba(59, 130, 246, 0.45);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(17, 17, 20, 0.92) 100%);
}

.plan-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.plan-duration {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-discount {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.plan-discount.is-accent {
  background: rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.plan-per-month {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Maximally Rounded White Pill Button */
.pill-white-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
}

.pill-white-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.18);
}

.pill-white-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.pill-white-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Sparks Card */
.sparks-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(20px);
}

.sparks-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.sparks-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sparks-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sparks-rate {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.sparks-input-group {
  margin-bottom: 14px;
}

.sparks-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sparks-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px 16px;
  transition: border-color var(--transition);
}

.sparks-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.32);
}

.sparks-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
}

.sparks-input::-webkit-outer-spin-button,
.sparks-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sparks-unit {
  font-size: 14px;
  font-weight: 600;
  color: #fbbf24;
}

.sparks-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.preset-chip {
  flex: 1;
  min-width: 72px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
}

.preset-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

.sparks-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.summary-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Toast Notification */
.store-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #18181b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: toastPop 0.25s ease-out;
}

.store-toast.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.store-toast.is-success {
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

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

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Responsive */
@media (max-width: 780px) {
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .benefits-list {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .lookup-card {
    padding: 22px 18px;
  }

  .username-input-wrap {
    padding: 5px 5px 5px 14px;
  }

  .lookup-submit-btn {
    padding: 9px 14px;
  }
}
