/* CraftixVPN Mini App — minimal blue, optimized for Telegram on phones */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg-soft: var(--tg-theme-secondary-bg-color, #fafafa);
  --border: #ececec;
  --text: var(--tg-theme-text-color, #0a0a0a);
  --text-mute: var(--tg-theme-hint-color, #8a8a8a);
  --accent: #00aaff;
  --accent-soft: rgba(0, 170, 255, 0.08);
  --accent-glow: rgba(0, 170, 255, 0.35);
  --radius-md: 14px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --border: #2a2a2a;
    --bg-soft: #161616;
  }
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 13px;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
}

/* ====== TOPBAR ====== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}

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

.brand-mark {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-mute);
  transition: all 0.3s ease;
}

body[data-status="connected"] .status-pill {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  transition: all 0.3s ease;
}

body[data-status="connected"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px var(--accent-soft); }
}

/* ====== HERO ====== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 0;
}

.globe {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.globe-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: all 0.4s ease;
}

.globe-flag {
  font-size: 56px;
  line-height: 1;
  filter: grayscale(0.3);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.globe-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

body[data-status="connected"] .globe-ring {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

body[data-status="connected"] .globe-flag {
  filter: grayscale(0);
  transform: scale(1.05);
}

body[data-status="connected"] .globe-pulse {
  animation: ring 2.4s ease-out infinite;
}

@keyframes ring {
  0%   { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0;   transform: scale(1.4);  }
}

.location {
  font-size: 14px;
  color: var(--text-mute);
  letter-spacing: -0.01em;
}

/* ====== POWER BUTTON ====== */
.power {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  transition: color 0.3s ease, transform 0.15s ease;
  margin-top: 6px;
}

.power-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: all 0.4s ease;
}

.power:active { transform: scale(0.97); }

body[data-status="connected"] .power { color: var(--accent); }

body[data-status="connected"] .power-ring {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 0 28px var(--accent-glow);
}

body[data-status="connecting"] .power-ring {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  font-size: 13px;
  color: var(--text-mute);
}

body[data-status="connected"] .hint { color: var(--accent); }

/* ====== META ====== */
.meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}

.meta-row:last-child { border-bottom: none; }

.meta-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.meta-value { color: var(--text); font-weight: 500; }

/* ====== FOOTER ====== */
.footer {
  padding: 14px 0 8px;
  text-align: center;
}

.footer-text {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
