:root {
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hidden { display: none !important; }
.active { display: flex !important; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s;
}

.input-group input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.primary-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.error-msg {
  color: var(--danger);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 250px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  margin: 16px;
}

.logo {
  margin-bottom: 40px;
  text-align: center;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  color: transparent;
}

.nav-links {
  list-style: none;
  flex: 1;
}

.nav-links li {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links li:hover, .nav-links li.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.logout-btn:hover {
  background: var(--danger);
  color: white;
}

.main-content {
  flex: 1;
  padding: 16px 16px 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--success);
  font-weight: 500;
  font-size: 0.9rem;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 8px var(--success); }
  50% { box-shadow: 0 0 16px var(--success), 0 0 24px var(--success); }
  100% { box-shadow: 0 0 8px var(--success); }
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseGlow 2s infinite;
}

.views {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 24px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.stat-card h3 {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  color: transparent;
}

/* Activities */
.activities-container, .system-container {
  padding: 32px;
}

.activities-container h2, .system-container h2 {
  margin-bottom: 24px;
}

.session-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.session-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--accent-color);
  font-weight: 600;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

/* System Health */
.resource {
  margin-bottom: 24px;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.progress-bar {
  height: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-color), #8b5cf6);
  width: 0%;
  transition: width 0.5s ease-out;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.metric {
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: 12px;
}

.metric h4 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.metric p {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chart-container {
  transition: transform 0.3s, box-shadow 0.3s;
}

.chart-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}
