:root {
  /* Deep Cyber Theme Colors */
  --bg-primary: #050505;
  --bg-secondary: #0a0a0f;
  --bg-card: #0d0d12;
  --text-main: #ffffff;
  --text-muted: #8a8a9e;
  --border-color: #1a1a24;

  /* Neon Glow Colors (Deep Cyber) */
  --neon-cyan: #00e5ff;
  --neon-purple: #b100ff;
  --neon-green: #00ff41;

  /* Glow Effects */
  --glow-cyan: 0 0 10px rgba(0, 229, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.2);
  --glow-purple: 0 0 10px rgba(177, 0, 255, 0.4), 0 0 20px rgba(177, 0, 255, 0.2);
  --glow-green: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.3);
  
  /* Layout */
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Map Styling */
.jvectormap-container {
  border-radius: 8px;
  overflow: hidden;
}
.jvectormap-zoomin, .jvectormap-zoomout {
  background: var(--border-color);
  color: var(--text-main);
  border-radius: 4px;
}

/* Loyalty Core */
.loyalty-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}
.loyalty-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--glow-color) 0%, #1a1a24 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--glow-color);
    transition: background 1s ease-out, box-shadow 1s ease-out;
    position: relative;
}
.loyalty-ring::before {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    background: var(--bg-card);
    border-radius: 50%;
}
.loyalty-score {
    position: relative;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px var(--glow-color);
    font-family: 'Courier New', Courier, monospace;
}
.loyalty-text {
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.03), transparent 25%),
                    radial-gradient(circle at 85% 30%, rgba(177, 0, 255, 0.03), transparent 25%);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Login Styles */
.login-input {
  width: 100%;
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.85); /* Strong white background */
  border: 2px solid rgba(0, 229, 255, 0.6);
  border-radius: 8px;
  color: #000000; /* Black text for contrast on white */
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.login-input:focus {
  background: #ffffff; /* Pure white on focus */
  border-color: rgba(0, 229, 255, 1);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.5), inset 0 2px 4px rgba(0,0,0,0.1);
}



.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, #00b4d8 100%);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.85rem;
}
.logout-btn:hover {
  border-color: rgba(177, 0, 255, 0.5);
  color: var(--text-main);
  background: rgba(177, 0, 255, 0.1);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3.5rem;
  text-align: center;
  letter-spacing: 1px;
}

.brand span {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

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

.nav-link svg {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.nav-link:hover svg, .nav-link.active svg {
  opacity: 1;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem 3.5rem;
  overflow-y: auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header h1 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.site-selector {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}
.site-selector:focus {
  border-color: rgba(0, 229, 255, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.top-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  grid-column: span 12;
}

.card {
  background-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 229, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: transparent;
  opacity: 0.7;
}

.card.neon-cyan::before { 
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent); 
}

.card.neon-purple::before { 
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent); 
}

.card.neon-green::before { 
  background: linear-gradient(90deg, transparent, var(--neon-green), transparent); 
}

.card-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

/* Specific Cards */
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: -1px;
}

.stat-value.live {
  color: var(--neon-green);
  text-shadow: var(--glow-green);
  display: flex;
  align-items: center;
}

.live-indicator {
  width: 12px;
  height: 12px;
  background-color: var(--neon-green);
  border-radius: 50%;
  margin-right: 12px;
  box-shadow: var(--glow-green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(57, 255, 20, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 255, 20, 0); }
}

.stat-change {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.stat-change.positive { color: var(--neon-green); }
.stat-change.negative { color: var(--neon-pink); }

/* Charts */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* List */
.data-list {
  list-style: none;
}

.data-list-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
}

.data-list-item:last-child {
  border-bottom: none;
}

.data-label {
  display: flex;
  align-items: center;
}

.data-value {
  font-weight: 600;
}

/* Code Snippet Area */
.snippet-box {
  background-color: #000;
  border: 1px solid var(--neon-cyan);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.1);
  position: relative;
  margin-top: 1rem;
}

.snippet-box code {
  color: var(--neon-green);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: var(--glow-cyan);
}

.logout-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 15px var(--neon-cyan);
}

/* Language Selector */
.lang-select {
  background: rgba(13, 13, 18, 0.6);
  border: 1px solid var(--neon-purple);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}
.lang-select:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.lang-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Safely move jsVectorMap Zoom Buttons to the right */
#world-map .jvm-zoom-btn {
  left: auto !important;
  right: 15px !important;
}



/* Responsive */
@media (max-width: 1200px) {
  .top-stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .col-span-3 { grid-column: span 6; }
  .col-span-8 { grid-column: span 12; }
  .col-span-4 { grid-column: span 12; }
  .top-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); flex-direction: row; align-items: center; justify-content: space-between; padding: 1rem; }
  .brand { margin-bottom: 0; font-size: 1.2rem; }
  .nav-link { margin-bottom: 0; margin-right: 0.5rem; padding: 0.5rem; font-size: 0.85rem; }
  .nav-link svg { margin-right: 5px; }
  .col-span-3, .col-span-4, .col-span-6, .col-span-8 { grid-column: span 12; }
  .main-content { padding: 1rem; }
  .top-stats-row { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
  .header h1 { font-size: 1.3rem; }
  #header-actions { flex-direction: column; width: 100%; align-items: stretch !important; }
  .lang-select { width: 100%; margin-bottom: 0.5rem; }
}
