/* ==========================================
   XXX VPN Mini App — Glass Shield Design
   Dark theme + Amber accents + Glassmorphism
   ========================================== */

:root {
  --bg-primary: #0F1923;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-active: rgba(245, 158, 11, 0.25);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --text-dim: rgba(255, 255, 255, 0.25);
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --emerald-400: #34d399;
  --blue-400: #60a5fa;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 448px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber-400);
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.9);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 10px;
  font-weight: 500;
  color: var(--emerald-400);
}

/* ========== PAGE CONTENT ========== */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 80px;
  position: relative;
  z-index: 5;
  -webkit-overflow-scrolling: touch;
}

.page-content::-webkit-scrollbar {
  display: none;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding: 0 8px 8px;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-item.active {
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.nav-item span {
  font-size: 9px;
  font-weight: 500;
}

/* ========== CARDS ========== */
.card {
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-card);
  padding: 16px;
  margin-bottom: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

.badge-active {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--emerald-400);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-400);
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
  height: 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 8px 0 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(to right, var(--amber-500), var(--amber-400));
  transition: width 0.8s ease-out;
}

/* ========== BUTTONS ========== */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(to right, var(--amber-500), var(--amber-400));
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-amber {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber-400);
}

/* ========== PLAN CARDS ========== */
.plan-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-card:active {
  transform: scale(0.98);
}

.plan-card.selected {
  background: rgba(245, 158, 11, 0.06);
  border-color: var(--border-active);
}

.plan-card .popular-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--amber-500);
  font-size: 10px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.plan-card.selected .plan-radio {
  border-color: var(--amber-400);
  background: var(--amber-400);
}

.plan-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s;
}

.plan-card.selected .plan-radio-dot {
  opacity: 1;
}

.plan-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-info {
  flex: 1;
}

.plan-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.plan-per-device {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.plan-price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-period {
  font-size: 10px;
  color: var(--text-dim);
}

.plan-discount {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.15);
  font-size: 10px;
  font-weight: 500;
  color: var(--emerald-400);
  margin-top: 8px;
  margin-left: 32px;
}

/* ========== CRYPTO BADGES ========== */
.crypto-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crypto-badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

/* ========== FAQ ========== */
.faq-item {
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  overflow: hidden;
  margin-bottom: 8px;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.faq-question:active {
  background: rgba(255, 255, 255, 0.02);
}

.faq-arrow {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 16px 16px;
}

.faq-answer-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

/* ========== REFERRAL ========== */
.referral-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.referral-link-text {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.referral-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-box {
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.stat-icon {
  width: 16px;
  height: 16px;
  margin: 0 auto 4px;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.amber {
  color: var(--amber-400);
}

.stat-label {
  font-size: 10px;
  color: var(--text-dim);
}

/* ========== FRIEND LIST ========== */
.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-400);
  flex-shrink: 0;
}

.friend-info {
  flex: 1;
}

.friend-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.friend-date {
  font-size: 10px;
  color: var(--text-dim);
}

.friend-bonus {
  font-size: 12px;
  font-weight: 500;
  color: var(--emerald-400);
}

/* ========== INSTALL GUIDE ========== */
.platform-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.platform-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-tab.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-400);
  flex-shrink: 0;
}

.step-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  padding-top: 3px;
  line-height: 1.4;
}

/* ========== HERO SECTION ========== */
.hero-section {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-primary), rgba(15, 25, 35, 0.8), transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 32px 20px 24px;
  text-align: center;
}

.hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.1);
  color: var(--amber-400);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.action-card {
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.action-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.action-icon.blue {
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue-400);
}

.action-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-400);
}

.action-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.action-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== REFERRAL BANNER ========== */
.referral-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.15);
  cursor: pointer;
  transition: transform 0.15s;
  margin-bottom: 12px;
}

.referral-banner:active {
  transform: scale(0.98);
}

.referral-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-400);
  flex-shrink: 0;
}

.referral-banner-text h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.referral-banner-text p {
  font-size: 12px;
  color: rgba(245, 158, 11, 0.7);
  margin-top: 2px;
}

/* ========== SUPPORT CARD ========== */
.support-card {
  border-radius: 16px;
  background: linear-gradient(to right, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(96, 165, 250, 0.15);
  padding: 16px;
  margin-bottom: 12px;
}

.support-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.support-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--blue-400);
  flex-shrink: 0;
}

.btn-blue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--blue-400);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-blue:active {
  transform: scale(0.97);
}

/* ========== SECTION HEADER ========== */
.section-header {
  font-size: 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ========== HOW TO PAY ========== */
.howto-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.howto-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amber-400);
}

.howto-left span {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.howto-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.howto-content.open {
  max-height: 500px;
}

.howto-inner {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeUp 0.3s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }

/* ========== LOADING ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========== MISC ========== */
.text-center { text-align: center; }
.text-xs { font-size: 12px; }
.text-dim { color: var(--text-dim); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

.bonus-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.1);
  margin-top: 12px;
}

.bonus-badge svg {
  width: 14px;
  height: 14px;
  color: var(--amber-400);
}

.bonus-badge span {
  font-size: 12px;
  color: rgba(245, 158, 11, 0.8);
}

/* Server map */
.server-map {
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  overflow: hidden;
  margin-bottom: 12px;
}

.server-map-img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  opacity: 0.6;
}

.server-map-info {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-map-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.server-map-location svg {
  width: 14px;
  height: 14px;
  color: var(--amber-400);
}

.server-map-protocol {
  font-size: 10px;
  color: var(--text-muted);
}

/* Rules text */
.rules-text {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* No subscription state */
.no-sub {
  text-align: center;
  padding: 24px 16px;
}

.no-sub-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.no-sub h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.no-sub p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
