/* Premium Glassmorphic Styling for MCP Student Registry */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0b0914;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  --primary-color: #00d2ff;
  --secondary-color: #f72585;
  --success-color: #06d6a0;
  --warning-color: #ffd166;
  --error-color: #ef476f;
  
  --primary-glow: rgba(0, 210, 255, 0.15);
  --secondary-glow: rgba(247, 37, 133, 0.15);
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Blobs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(120px);
  pointer-events: none;
}

body::before {
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
}

body::after {
  bottom: -150px;
  left: -50px;
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
}

/* App Layout */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* Header */
header {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.logo-section h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  position: relative;
}

.status-dot.active {
  background-color: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
  animation: pulse 2s infinite;
}

.status-dot.demo {
  background-color: var(--warning-color);
  box-shadow: 0 0 10px var(--warning-color);
  animation: pulse-warn 2s infinite;
}

.status-dot.disconnected {
  background-color: var(--error-color);
  box-shadow: 0 0 10px var(--error-color);
}

/* Content Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Panel */
.panel {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* Inputs & Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(255, 255, 255, 0.08);
}

.form-control[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle Switch */
.switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  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);
  border: 1px solid var(--border-color);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--secondary-color);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(247, 37, 133, 0.3);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #white;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0066ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Main Panel Tabs & Views */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-bar-container {
  display: flex;
  gap: 12px;
}

.search-bar-container .form-control {
  flex: 1;
}

.dashboard-views {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.name-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  animation: fadeIn 0.4s ease-out;
}

.name-card:hover {
  transform: translateY(-4px) scale(1.02);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(0, 210, 255, 0.15);
}

.name-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.name-card-name {
  font-weight: 600;
  font-size: 1rem;
}

/* Custom Table View */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.01);
}

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

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Score highlight values */
.score-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

.score-high {
  background: rgba(6, 214, 160, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(6, 214, 160, 0.25);
}

.score-low {
  background: rgba(239, 71, 111, 0.15);
  color: var(--error-color);
  border: 1px solid rgba(239, 71, 111, 0.25);
}

.score-mid {
  background: rgba(255, 209, 102, 0.15);
  color: var(--warning-color);
  border: 1px solid rgba(255, 209, 102, 0.25);
}

/* Loader Animation */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-banner {
  background: rgba(239, 71, 111, 0.1);
  border: 1px solid rgba(239, 71, 111, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ef476f;
  margin-top: 10px;
}

/* Utility Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(6, 214, 160, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(6, 214, 160, 0); }
}

@keyframes pulse-warn {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 209, 102, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
}

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