/* CSS Design System - VPN Ghost */

:root {
  /* Harmonious Dark Space Palette */
  --bg-deep: hsl(228, 45%, 4%);
  --bg-dark: hsl(228, 30%, 8%);
  --bg-panel: hsla(228, 25%, 12%, 0.45);
  --bg-panel-hover: hsla(228, 25%, 16%, 0.6);
  --border-light: hsla(0, 0%, 100%, 0.07);
  --border-glow: hsla(170, 100%, 50%, 0.15);

  /* Primary Neon Colors */
  --color-cyan: hsl(170, 100%, 50%);
  --color-cyan-glow: hsla(170, 100%, 50%, 0.4);
  --color-purple: hsl(275, 95%, 65%);
  --color-purple-glow: hsla(275, 95%, 65%, 0.4);
  --color-emerald: hsl(145, 90%, 50%);
  --color-emerald-glow: hsla(145, 90%, 50%, 0.4);
  --color-ruby: hsl(355, 90%, 60%);

  /* Text colors */
  --text-main: hsl(220, 30%, 96%);
  --text-muted: hsl(220, 20%, 78%);
  --text-dimmed: hsl(220, 15%, 62%);

  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background-color: var(--bg-deep);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: hsl(228, 20%, 18%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-purple-glow);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Ambient glow blobs in background */
.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  animation: pulse-glow 15s infinite alternate ease-in-out;
}

.ambient-glow.bg-cyan {
  top: -10%;
  right: 5%;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
}

.ambient-glow.bg-purple {
  bottom: 10%;
  left: -10%;
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
  animation-delay: -5s;
}

@keyframes pulse-glow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.15; }
  50% { transform: scale(1.15) translate(4%, -2%); opacity: 0.22; }
  100% { transform: scale(0.9) translate(-2%, 4%); opacity: 0.15; }
}

/* Header & Navigation */
.app-header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: hsla(228, 45%, 4%, 0.7);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-svg {
  width: 32px;
  height: 32px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.brand-text .accent-text {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-link:hover {
  color: var(--color-cyan);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: hsla(0, 0%, 100%, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.status-indicator-dot.disconnected {
  background-color: var(--color-ruby);
  box-shadow: 0 0 8px var(--color-ruby);
}

.status-indicator-dot.connecting {
  background-color: var(--color-purple);
  box-shadow: 0 0 8px var(--color-purple);
  animation: pulse-dot 1s infinite alternate;
}

.status-indicator-dot.connected {
  background-color: var(--color-emerald);
  box-shadow: 0 0 10px var(--color-emerald);
}

@keyframes pulse-dot {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Glassmorphism Panel styles */
.glass-panel {
  background-color: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}

.glass-panel:hover {
  background-color: var(--bg-panel-hover);
  border-color: hsla(0, 0%, 100%, 0.12);
}

/* Dashboard Wrapper & Grid */
.dashboard-wrapper {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .main-nav {
    display: none; /* simple mobile design */
  }
}

.dash-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
}

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

.card-title {
  font-size: 1.25rem;
  color: var(--text-main);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 12px;
  background: hsla(275, 95%, 65%, 0.15);
  color: var(--color-purple);
  border: 1px solid hsla(275, 95%, 65%, 0.25);
  text-transform: uppercase;
}

/* Core Control Center (Left panel) */
.control-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  gap: 32px;
}

.vpn-power-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  outline: none;
  position: relative;
  background: radial-gradient(circle, hsl(228, 20%, 15%) 0%, hsl(228, 25%, 8%) 100%);
  border: 4px solid hsl(228, 15%, 15%);
  color: var(--text-muted);
  box-shadow: 0 20px 40px hsla(0, 0%, 0%, 0.4);
  transition: all var(--transition-normal);
}

.power-btn-inner {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(228, 25%, 18%) 0%, hsl(228, 30%, 10%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-normal);
  z-index: 2;
}

.power-icon {
  width: 44px;
  height: 44px;
  transition: transform 0.5s ease, stroke var(--transition-normal);
}

/* Power button state modifiers */
.vpn-power-btn.disconnected:hover {
  color: var(--color-cyan);
  box-shadow: 0 0 30px var(--color-cyan-glow);
  transform: translateY(-2px);
}

.vpn-power-btn.connecting {
  border-color: var(--color-purple);
  color: var(--color-purple);
  box-shadow: 0 0 35px var(--color-purple-glow);
  animation: button-pulse 1.5s infinite alternate ease-in-out;
}

.vpn-power-btn.connecting .power-icon {
  animation: spin-pulse 2s infinite linear;
}

.vpn-power-btn.connected {
  border-color: var(--color-emerald);
  color: var(--color-emerald);
  box-shadow: 0 0 45px var(--color-emerald-glow);
  transform: scale(1.02);
}

.vpn-power-btn.connected .power-icon {
  transform: rotate(180deg);
}

/* Ripples for active state */
.ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--color-emerald);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.vpn-power-btn.connected .ripple:nth-child(2) {
  animation: ripple-effect 3s infinite linear;
}

.vpn-power-btn.connected .ripple:nth-child(3) {
  animation: ripple-effect 3s infinite linear;
  animation-delay: 1.5s;
}

@keyframes ripple-effect {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes button-pulse {
  0% { box-shadow: 0 0 15px var(--color-purple-glow); }
  100% { box-shadow: 0 0 40px hsla(275, 95%, 65%, 0.6); }
}

@keyframes spin-pulse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Status block typography */
.status-block {
  text-align: center;
  max-width: 320px;
}

.status-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-dimmed);
  margin-bottom: 6px;
}

.status-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  transition: color var(--transition-normal);
}

.text-disconnected {
  color: var(--text-muted);
}

.text-connecting {
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine-text 3s infinite alternate;
}

.text-connected {
  color: var(--color-emerald);
  text-shadow: 0 0 15px hsla(145, 90%, 50%, 0.2);
}

.status-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Bottom metrics grid */
.session-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
}

.metric-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dimmed);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.metric-value.text-muted {
  color: var(--text-dimmed);
}

/* Bandwidth & Telemetry styles (Right panel) */
.bandwidth-numbers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.speed-counter {
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
}

.speed-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dimmed);
  display: block;
  margin-bottom: 8px;
}

.speed-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.speed-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.speed-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.graph-container {
  background: hsla(0, 0%, 0%, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#speed-chart {
  width: 100%;
  height: 100%;
  max-height: 190px;
}

.graph-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.color-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.bg-cyan { background-color: var(--color-cyan); }
.bg-purple { background-color: var(--color-purple); }

.telemetry-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.telemetry-stat strong {
  color: var(--text-main);
  font-family: var(--font-display);
  margin-left: 4px;
}

/* Server Selection Grid Section */
.server-selection-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.server-card {
  cursor: pointer;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.server-card:hover {
  background-color: var(--bg-panel-hover);
  border-color: var(--color-cyan-glow);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px hsla(170, 100%, 50%, 0.05);
}

.server-card.selected {
  background: hsla(170, 100%, 50%, 0.06);
  border-color: var(--color-cyan);
  box-shadow: 0 10px 25px hsla(170, 100%, 50%, 0.1);
}

.server-card.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 4px;
  background: var(--color-cyan);
}

.server-info-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Styled flag placeholder/icon */
.flag-container {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: hsl(228, 20%, 16%);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.server-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.server-country {
  font-weight: 600;
  font-size: 0.95rem;
}

.server-city {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.server-metrics-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ping-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 8px;
}

.ping-green {
  background: hsla(145, 90%, 50%, 0.15);
  color: var(--color-emerald);
}

.ping-amber {
  background: hsla(38, 90%, 50%, 0.15);
  color: hsl(38, 90%, 50%);
}

.server-capacity-bar {
  width: 50px;
  height: 4px;
  background: hsl(228, 20%, 18%);
  border-radius: 2px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

/* Feature Benefits Grid */
.benefits-section {
  display: flex;
  flex-direction: column;
  gap: 36px;
  border-top: 1px solid var(--border-light);
  padding-top: 48px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.benefit-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.benefit-icon svg {
  width: 20px;
  height: 20px;
}

.bg-cyan-glow {
  background: hsla(170, 100%, 50%, 0.1);
  color: var(--color-cyan);
  border-color: hsla(170, 100%, 50%, 0.2);
}

.bg-purple-glow {
  background: hsla(275, 95%, 65%, 0.1);
  color: var(--color-purple);
  border-color: hsla(275, 95%, 65%, 0.2);
}

.bg-emerald-glow {
  background: hsla(145, 90%, 50%, 0.1);
  color: var(--color-emerald);
  border-color: hsla(145, 90%, 50%, 0.2);
}

.benefit-card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.benefit-card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Premium pricing box CTA */
.cta-pricing-section {
  margin-top: 20px;
  margin-bottom: 40px;
}

.highlight-panel {
  border-color: hsla(275, 95%, 65%, 0.35);
  box-shadow: 0 20px 40px hsla(275, 95%, 65%, 0.05);
  position: relative;
}

.badge-ribbon {
  position: absolute;
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: var(--bg-deep);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 12px;
}

.pricing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0;
  gap: 16px;
  max-width: 650px;
  margin: 0 auto;
}

.pricing-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.pricing-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0;
}

.price-val {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-period {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pricing-subtext {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

.cta-primary-btn {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 12px;
  padding: 16px 36px;
  cursor: pointer;
  box-shadow: 0 10px 20px hsla(170, 100%, 50%, 0.15);
  transition: all var(--transition-normal);
}

.cta-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px hsla(275, 95%, 65%, 0.35);
  filter: brightness(1.1);
}

/* Footer styling */
.app-footer {
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-dark);
  padding: 48px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-text-footer {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.brand-text-footer .accent-text {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--color-cyan);
}

.footer-copy {
  color: var(--text-dimmed);
  margin-top: 12px;
}

@media (max-width: 600px) {
  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}
