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

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-deep: #0f172a;
  --bg-surface: rgba(30, 41, 59, 0.7);
  --bg-card: rgba(51, 65, 85, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --radius-xl: 1rem;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Decoration */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  right: -10%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  z-index: -1;
  filter: blur(80px);
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
  z-index: -1;
  filter: blur(80px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

.title-gradient {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass UI Elements */
.glass-pane {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Layout Parts */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.grid-container {
  display: grid;
  gap: 1.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 2.5rem;
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

/* Seat and Student Cards */
.seat-card {
  width: 140px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
}

.seat-card:hover {
  transform: translateY(-5px);
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.seat-card.empty {
  opacity: 0.3;
  cursor: default;
  background: transparent;
  border-style: dashed;
}

.seat-card.empty:hover {
  transform: none;
  box-shadow: none;
}

.score-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  padding: 0 0.4rem;
}

.student-name {
  font-weight: 500;
  font-size: 1rem;
  text-align: center;
  word-break: break-all;
  padding: 0 0.5rem;
}

/* Animations */
@keyframes pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.view {
  animation: pop 0.4s ease-out;
}

.score-btn:active {
  transform: scale(0.95);
}

/* Responsive Grid Adjustments */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  header { flex-direction: column; gap: 1rem; text-align: center; }
  .seat-card { width: 100px; height: 80px; }
  .student-name { font-size: 0.85rem; }
}

/* Cloud Status Indicator */
.cloud-status {
  position: relative;
  font-size: 1.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

.cloud-status.syncing i {
  animation: cloud-pulse 1.5s infinite;
  color: var(--primary);
}

.cloud-status.success i {
  color: var(--accent-success);
}

.cloud-status.error i {
  color: var(--accent-danger);
}

.status-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  border: 1.5px solid var(--bg-deep);
}

.cloud-status.success .status-dot {
  background: var(--accent-success);
}

.cloud-status.error .status-dot {
  background: var(--accent-danger);
}

.cloud-status.syncing .status-dot {
  background: var(--primary);
  animation: pulse-dot 1s infinite;
}

@keyframes cloud-pulse {
  0% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.5; transform: scale(1); }
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}
