:root {
  --bg-deep-space: #090a0f;
  --bg-panel: rgba(15, 20, 35, 0.7);
  --neon-cyan: #0ff;
  --neon-cyan-dim: rgba(0, 255, 255, 0.3);
  --neon-gold: #ffd700;
  --text-main: #e0e6ed;
  --text-muted: #8a95a5;
  --danger: #ff3366;
  --success: #33ff99;
  
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
  background-color: var(--bg-deep-space);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Effects */
#starfield {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -2;
  background: transparent;
  pointer-events: none;
}

#scanlines {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0,0,0,0.2) 50%,
    rgba(0,0,0,0.2)
  );
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.4;
}

/* Typography & Utilities */
h1, h2, h3 { font-family: var(--font-display); }
.neon-text { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); }
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--neon-cyan-dim);
}

/* Ticker Tape */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(0,0,0,0.8);
  border-bottom: 1px solid var(--neon-cyan);
  white-space: nowrap;
  padding: 5px 0;
  position: relative;
  z-index: 10;
}

.ticker-tape {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.ticker-item {
  display: inline-block;
  margin-right: 40px;
}
.ticker-item span { color: var(--neon-gold); }

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: rgba(9, 10, 15, 0.9);
  backdrop-filter: blur(5px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  pointer-events: auto;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 5px var(--neon-cyan);
}

.cart-btn {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-fast);
  box-shadow: 0 0 10px inset transparent;
}

.cart-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 10px inset var(--neon-cyan);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.hamburger span {
  width: 25px; height: 3px;
  background: var(--neon-cyan);
  transition: 0.3s;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 5%;
  min-height: 60vh;
  position: relative;
  pointer-events: none;
}

.hero-content {
  flex: 1;
  max-width: 600px;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--neon-cyan-dim);
  backdrop-filter: blur(10px);
}

.glitch {
  font-size: 4rem;
  font-weight: 900;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.025em -0.05em 0 rgba(0,255,0,0.75), 0.025em 0.05em 0 rgba(0,0,255,0.75);
  animation: glitch 500ms infinite;
}

@keyframes glitch {
  0% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
  14% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
  15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
  49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
  50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
  99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
  100% { text-shadow: -0.025em 0 0 rgba(255,0,0,0.75), -0.025em -0.025em 0 rgba(0,255,0,0.75), -0.025em -0.05em 0 rgba(0,0,255,0.75); }
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.stat-box {
  background: var(--bg-panel);
  border-left: 3px solid var(--neon-cyan);
  padding: 1rem;
  min-width: 150px;
}

.stat-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 2rem; font-family: var(--font-display); color: var(--neon-cyan); font-weight: bold; }

/* Globe Background Container */
.globe-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: auto;
}

/* WebGL Globe Tooltip */
.globe-tooltip {
  padding: 0.5rem 1rem;
  color: var(--text-main);
  pointer-events: none;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 4px;
}
/* Marketplace Section */
.marketplace {
  padding: 2rem 5%;
  pointer-events: none;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  pointer-events: auto;
}

.search-box input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--neon-cyan-dim);
  color: var(--text-main);
  padding: 0.8rem 1.2rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  width: 300px;
  outline: none;
  transition: var(--transition-fast);
}
.search-box input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--neon-cyan-dim);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 10px var(--neon-cyan);
}

/* Country Grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.country-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--neon-cyan-dim);
  border-radius: 8px;
  padding: 1.5rem;
  overflow: hidden;
  transition: var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px);
  cursor: pointer;
  pointer-events: auto;
}

.country-card.show {
  opacity: 1;
  transform: translateY(0);
}

.country-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flag { font-size: 2rem; }
.country-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--neon-cyan); }
.hot-tag {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
  font-weight: bold;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(255, 51, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

.card-stats { margin-bottom: 1.5rem; }
.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.stat-name { color: var(--text-muted); }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--neon-gold);
  font-weight: bold;
}

.add-btn {
  background: transparent;
  color: var(--success);
  border: 1px solid var(--success);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.add-btn:hover {
  background: rgba(51, 255, 153, 0.2);
  box-shadow: 0 0 10px rgba(51, 255, 153, 0.4);
}

/* Cart Modal */
.cart-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-modal {
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: var(--bg-deep-space);
  border-left: 2px solid var(--neon-cyan);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-overlay.active .cart-modal {
  transform: translateX(0);
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-header h2 { font-size: 1.2rem; color: var(--neon-cyan); }
.close-btn { font-size: 2rem; color: var(--text-main); background: none; border: none; cursor: pointer; }

.cart-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.empty-cart { text-align: center; color: var(--text-muted); margin-top: 2rem; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cart-item-info { display: flex; align-items: center; gap: 1rem; }
.cart-item-name { font-weight: bold; }
.cart-item-price { color: var(--neon-gold); font-family: var(--font-display); font-size: 0.9rem; }
.remove-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.2rem; }

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
}
.cart-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1rem; }
.cart-total span { color: var(--neon-gold); }
.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--neon-cyan);
  color: #000;
  border: none;
  font-family: var(--font-display);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
}
.checkout-btn:hover { box-shadow: 0 0 15px var(--neon-cyan); }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-panel);
  border-left: 4px solid var(--neon-cyan);
  padding: 1rem;
  min-width: 250px;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  animation: slideIn 0.3s forwards, fadeOut 0.3s forwards 2.7s;
  font-family: var(--font-body);
}

.toast.remove { border-left-color: var(--danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Responsive */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; gap: 2rem; }
  .hero-stats { justify-content: center; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-box input { width: 100%; }
}

@media (max-width: 600px) {
  .hamburger { display: flex; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: rgba(9, 10, 15, 0.95);
    flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-menu.active { max-height: 200px; border-bottom: 1px solid var(--neon-cyan-dim); }
  .nav-link { padding: 1rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
}
