@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #53fc18;
  --primary-glow: rgba(83, 252, 24, 0.4);
  --bg-dark: #090a0f;
  --bg-panel: #13151c;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: #8b92a5;
  --danger: #ff4747;
  --danger-glow: rgba(255, 71, 71, 0.3);
  --success: #53fc18;
  --warning: #ffb84d;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-main: 'Outfit', sans-serif;
  --shadow-glow: 0 0 20px var(--primary-glow);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Base Layouts */
.hidden { display: none !important; }

/* Privacy & Streamer Mode */
body.streamer-mode .private-info:not(.unblurred) {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.private-info.blurred-always:not(.unblurred) {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: 0.875rem; }

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #000;
  box-shadow: 0 4px 15px rgba(83, 252, 24, 0.2);
}

.btn-primary:hover {
  background-color: #6dff38;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(83, 252, 24, 0.4);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background-color: var(--bg-glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger-outline:hover {
  background-color: var(--danger);
  color: #fff;
  box-shadow: 0 0 15px var(--danger-glow);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  cursor: pointer;
}
.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.switch-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 3rem; letter-spacing: -1px; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; letter-spacing: -0.5px; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
p { line-height: 1.6; }

/* Views */
.view-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Background Gradients */
.bg-glow-1 {
  position: fixed;
  top: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(83,252,24,0.05) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-2 {
  position: fixed;
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(45,100,250,0.05) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-primary { background: rgba(83, 252, 24, 0.15); color: var(--primary); border: 1px solid rgba(83, 252, 24, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.badge-success { background: rgba(0, 255, 100, 0.15); color: #00ff64; border: 1px solid rgba(0, 255, 100, 0.3); }
.badge-danger { background: rgba(255, 71, 71, 0.15); color: var(--danger); border: 1px solid rgba(255, 71, 71, 0.3); }
.badge-warning { background: rgba(255, 184, 77, 0.15); color: var(--warning); border: 1px solid rgba(255, 184, 77, 0.3); }

/* Layout App */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  z-index: 10;
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width: 80px;
  padding: 1.5rem 1rem;
}

.sidebar.collapsed .sidebar-text {
  display: none !important;
}

.sidebar.collapsed .sidebar-icon-only {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.sidebar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed .nav-link {
  padding: 0.8rem;
  justify-content: center;
}

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

.nav-link.active {
  background-color: rgba(83, 252, 24, 0.1);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.user-info {
  margin-bottom: 1rem;
}

.main-content {
  flex: 1;
  background-color: var(--bg-dark);
  padding: 2.5rem 3rem;
  overflow-y: auto;
  position: relative;
  z-index: 5;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

th {
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-close:hover {
  color: var(--text-main);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.alert-danger {
  background-color: rgba(255, 71, 71, 0.1);
  border: 1px solid rgba(255, 71, 71, 0.3);
  color: #ff6b6b;
}
.alert-success {
  background-color: rgba(83, 252, 24, 0.1);
  border: 1px solid rgba(83, 252, 24, 0.3);
  color: var(--primary);
}
.alert-info {
  background-color: rgba(45, 100, 250, 0.1);
  border: 1px solid rgba(45, 100, 250, 0.3);
  color: #6b93ff;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

/* Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.auth-tab:hover {
  color: var(--text-main);
}
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Server Cards Specifics */
.server-card {
  display: flex;
  flex-direction: column;
}
.server-card .api-key-box {
  background: rgba(0,0,0,0.4);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px dashed var(--border);
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  margin: 1rem 0;
  color: var(--text-muted);
}
