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

:root {
  --bg-dark: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  padding: 24px;
}

/* Base Layouts */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  box-shadow: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.form-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  transition: all 0.3s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.user-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--success-glow);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}
.panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Gauges */
.gauges-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 150px;
  padding: 20px 0;
}
.gauge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gauge-bar {
  width: 60px;
  height: 100px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.gauge-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--success), #34d399);
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.gauge-fill.warning { background: linear-gradient(to top, var(--warning), #fbbf24); }
.gauge-fill.danger { background: linear-gradient(to top, var(--danger), #f87171); }
.gauge-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.gauge-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Vector Bars */
.vector-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vector-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vector-info {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.vector-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.vector-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 4px;
  transition: width 1s ease-in-out;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Audit / Sessions Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}
.data-table td {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.td-time { color: var(--text-muted); font-size: 0.8rem !important; }
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
}
.badge-admin { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-crew { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-guest { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Chat UI */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 70vh;
  margin-top: 20px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  max-width: 80%;
  align-self: flex-start;
  animation: slideIn 0.3s ease-out forwards;
}
.chat-message.system {
  background: transparent;
  color: var(--text-muted);
  font-style: italic;
  align-self: center;
  font-size: 0.9rem;
}
.chat-message .meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--primary);
  font-family: var(--font-mono);
}
.chat-input-area {
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 12px;
}

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

/* Utils */
.scrollable {
  max-height: 400px;
  overflow-y: auto;
}
.scrollable::-webkit-scrollbar {
  width: 6px;
}
.scrollable::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
.scrollable::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.pulsing {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
