/* Modern CSS for Zoss Game Portal - Dark Futuristic Glassmorphism */

:root {
  --bg-color: #08060f;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-shadow: rgba(0, 0, 0, 0.45);
  
  --text-main: #f3f1f7;
  --text-muted: #8e8a9f;
  
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.35);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.35);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --accent-red: #ef4444;
  
  --font-display: 'Outfit', 'Noto Sans SC', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-display);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

body.dark-theme {
  background-color: var(--bg-color);
}

/* Background floating glow balls */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ball {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  animation: float 20s infinite alternate;
}

.ball-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-blue);
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.ball-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  bottom: -20%;
  right: -10%;
  animation-duration: 30s;
}

.ball-3 {
  width: 400px;
  height: 400px;
  background: #ec4899;
  top: 40%;
  left: 45%;
  animation-duration: 18s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, -60px) scale(0.9); }
}

/* Utility classes */
.hide {
  display: none !important;
}

.code {
  font-family: 'Courier New', Courier, monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 12px 40px 0 var(--panel-shadow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-icon svg, .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--panel-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-icon {
  background: transparent;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Login Panel */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header .logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Forms */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group, .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
  outline: none;
}

.error-msg {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Workspace Layout */
.workspace-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar styling */
.sidebar {
  width: 260px;
  background: rgba(10, 8, 20, 0.7);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 10;
}

.sidebar-header {
  margin-bottom: 35px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-header .logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-purple-glow);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.2);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
  width: 100%;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: var(--accent-blue-glow);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--panel-border);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info .avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.user-info .details {
  display: flex;
  flex-direction: column;
}

.user-info .username {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-info .role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Container */
.content-container {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  z-index: 5;
}

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

.content-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.content-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* KPI Dash Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 35px;
}

.kpi-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.icon-green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); }
.icon-yellow { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-data .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-data h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2px 0;
}

.kpi-data .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.015) 0%, transparent 60%);
  pointer-events: none;
}

/* Charts & Lists layout */
.analytics-row {
  display: flex;
  gap: 24px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.chart-card, .list-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  height: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px 10px 10px 10px;
  position: relative;
}

.chart-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
}

/* CSS SVG Custom Chart */
.chart-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 32px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(0deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.2);
}

.chart-bar:hover {
  filter: brightness(1.2);
}

.chart-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Game Grid styling */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.game-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.game-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
  opacity: 0.7;
}

.game-card.active::before {
  background: var(--accent-green);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.game-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.game-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.game-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-blue-glow);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.game-status-badge.active {
  background: var(--accent-green-glow);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.game-stats-mini {
  display: flex;
  gap: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.stat-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-item .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.game-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.game-card-actions .btn {
  flex: 1;
}

.game-quick-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  transition: var(--transition-smooth);
}

.quick-game-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.quick-game-item .info {
  display: flex;
  flex-direction: column;
}

.quick-game-item .name {
  font-size: 0.95rem;
  font-weight: 600;
}

.quick-game-item .dau {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* API Config page */
.config-container {
  display: flex;
  gap: 24px;
}

.sidebar-panel {
  width: 320px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-panel {
  flex-grow: 1;
  padding: 30px;
}

.select-wrapper {
  position: relative;
}

.credentials-box {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
}

.cred-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cred-item .value {
  color: var(--text-main);
  word-break: break-all;
}

.cred-item .value.clickable {
  cursor: pointer;
}

/* Toggle Switches */
.switch-container {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  border: 1px solid var(--panel-border);
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--accent-blue);
  border-color: transparent;
}

input:checked + .switch-slider:before {
  transform: translateX(22px);
}

.form-row {
  display: flex;
  gap: 20px;
}

.divider {
  height: 1px;
  background: var(--panel-border);
  margin: 25px 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.success-text {
  color: var(--accent-green);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 3, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 30px;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  animation: modalEnter 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.console-card {
  max-width: 90vw;
  width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-header h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

/* Console modal iframe container */
.console-body {
  flex-grow: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--panel-border);
}

.console-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Service Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.service-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.service-table th, .service-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.95rem;
}

.service-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

.service-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 8px currentColor;
}

.status-indicator.active {
  color: var(--accent-green);
}

.status-indicator.active::before {
  background: var(--accent-green);
}

/* AI Auto-Audio Styling */
.auto-vibe-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

.auto-vibe-btn.active {
  background: var(--accent-blue-glow) !important;
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.auto-audio-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: var(--transition-smooth);
}

.auto-audio-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 242, 254, 0.2);
  transform: translateY(-2px);
}

.auto-audio-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.auto-audio-card .badge-osc {
  font-size: 0.7rem;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

.auto-audio-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--panel-border);
}

.auto-audio-card-footer .sound-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn-play-auto {
  background: var(--accent-blue-glow);
  border: 1px solid var(--accent-blue);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-play-auto:hover {
  background: var(--accent-blue);
  transform: scale(1.1);
}

