/* ============================================================
   WSocks Mini App — Base Styles (shared across all pages)
   ============================================================ */

:root {
  --bg: #000000;
  --text: #ffffff;
  --accent: #ffffff;
  --accent-hover: #e0e0e0;
  --card: #181818;
  --card-hover: #222222;
  --border: #262626;
  --group-bg: #181818;
  --btn-bg: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --blur: 16px;
  --gap: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

button, a, .btn, .support-option-btn, .copy-btn, .modal-close, .tab-btn, .theme-toggle, .back-link {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

button:focus, a:focus, .btn:focus, .support-option-btn:focus, .copy-btn:focus, .modal-close:focus, .tab-btn:focus, .theme-toggle:focus, .back-link:focus {
  outline: none;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(15px, 0.9rem + 0.25vw, 16px);
  color-scheme: dark light;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 4vw, 24px);
  min-height: 100vh;
  line-height: 1.45;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #181818;
}
::-webkit-scrollbar-thumb {
  background: #3a3a4d;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a4a60;
}

/* Glass morphism */
.glass {
  background: rgba(24, 24, 24, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #ffffff, #888888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-blue {
  background: linear-gradient(135deg, #ffffff, #555555);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Neon border */
.neon-border {
  box-shadow: 0 0 0 1px #ffffff, 0 0 15px rgba(255, 255, 255, 0.15), inset 0 0 15px rgba(255, 255, 255, 0.02);
}

/* Card hover */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(46, 98, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(46, 98, 246, 0.6);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: #000000;
  border: 1px solid #333333;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  transition: 0.3s ease;
}

.theme-toggle svg path {
  stroke: currentColor;
  stroke-width: inherit;
}

/* Back link */
.back-link {
  position: fixed;
  top: 20px;
  left: max(16px, calc(50% - 260px + 16px));
  z-index: 900;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.back-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
}

.back-link:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: var(--card-hover);
}

/* Card base */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: cardSlideIn 0.5s ease-out both;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
}

.card:nth-child(2) {
  animation-delay: 0.2s;
}

.card h1, .card h2 {
  margin: 0;
  font-size: clamp(1.3rem, 1.2rem + 0.6vw, 1.6rem);
  text-align: center;
}

.card p {
  margin: 0;
  color: rgba(255,255,255,0.75);
  text-align: center;
}

/* ============================================================
   Light theme overrides (shared)
   ============================================================ */

.light {
  --bg: #ffffff;
  --text: #000000;
  --accent: #000000;
  --accent-hover: #222222;
  --card: #ffffff;
  --card-hover: #f5f5f5;
  --border: #e0e0e0;
  --group-bg: #f5f5f5;
  --btn-bg: rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  color: var(--text);
}

.light body {
  background-color: #ffffff;
}

.light .theme-toggle {
  background: #ffffff;
  border-color: #e0e0e0;
}

.light .theme-toggle svg {
  fill: none;
  stroke: #000000;
  stroke-width: 3;
}

.light .theme-toggle svg path {
  stroke: #000000;
  stroke-width: 3 !important;
}

.light .card {
  background: #ffffff;
  border-color: #e0e0e0;
}

.light .back-link {
  color: var(--text);
}

.light .back-link:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.light .back-link svg {
  stroke: currentColor;
}

/* ============================================================
   Global Monochrome Overrides (High specificity overrides)
   ============================================================ */

/* Remove inline colors from extend/paid gift buttons */
#extend-gift-btn, #paid-gift-btn {
  color: var(--text) !important;
  border-color: var(--border) !important;
  background: transparent !important;
}
#extend-gift-btn:hover, #paid-gift-btn:hover {
  background: var(--btn-bg) !important;
}

/* Invert confirmation buttons for crisp monochrome theme */
#trial-confirm-ok, #paid-confirm-ok, #gift-confirm-ok {
  background: var(--text) !important;
  color: var(--bg) !important;
  border: none !important;
}
#trial-confirm-ok:hover, #paid-confirm-ok:hover, #gift-confirm-ok:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px);
}

/* Light mode overrides */
.light .gradient-text {
  background: linear-gradient(135deg, #000000, #555555) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.light .gradient-text-blue {
  background: linear-gradient(135deg, #000000, #888888) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.light .neon-border {
  box-shadow: 0 0 0 1px #000000, 0 0 15px rgba(0, 0, 0, 0.05), inset 0 0 15px rgba(0, 0, 0, 0.01) !important;
}

/* Grayscale background/hero glow elements */
.hero-glow, .glow-1, .glow-2 {
  background: rgba(255, 255, 255, 0.04) !important;
  filter: blur(50px) grayscale(100%) !important;
}
.light .hero-glow, .light .glow-1, .light .glow-2 {
  background: rgba(0, 0, 0, 0.02) !important;
}
