/* ==========================================================
   AkademikSemantics - Modern CSS Design System
   Color Palette: Deep Slate, Indigo Glow, Cyan Accent, Emerald
   Aesthetics: Glassmorphism, Micro-interactions, Clean Grid
========================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-card-solid: #111827;
  --bg-header: rgba(11, 15, 25, 0.88);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-focus: rgba(99, 102, 241, 0.5);

  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent-cyan: #38BDF8;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;
  --accent-purple: #A855F7;

  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(56, 189, 248, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}

/* Mobile Toggle Wrap & Hamburger */
.mobile-nav-toggle-wrap {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 8px;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-hamburger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-hamburger span {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.mobile-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-info h1 span {
  background: linear-gradient(90deg, #A5B4FC, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Nav Menu Tabs */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.nav-link i {
  font-size: 0.9rem;
}

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

.nav-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Auth / Role Switcher */
.auth-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.role-badge.user-mode {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38BDF8;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==================== BUTTONS & UI ATOMS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-danger-sm {
  background: rgba(244, 63, 94, 0.12);
  color: #FB7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-danger-sm:hover {
  background: var(--accent-rose);
  color: #fff;
}

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

.btn-close:hover {
  color: #fff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-accent {
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ==================== MAIN CONTENT & LAYOUT ==================== */
.main-content {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.page-header h2 i {
  color: var(--primary);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.3rem;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-emerald); }

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.75rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==================== HERO BANNER ==================== */
.hero-banner {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-text h2 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0.85rem 0 1rem;
  letter-spacing: -0.02em;
}

.hero-text p {
  color: #D1D5DB;
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hero-stats-card {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.glass-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

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

.hero-role-info {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.hero-role-info i {
  color: var(--primary);
  font-size: 1.1rem;
  margin-top: 0.15rem;
}

.hero-role-info strong {
  display: block;
  font-size: 0.85rem;
  color: #E0E7FF;
}

.hero-role-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Feature Cards */
.feature-card {
  padding: 1.75rem;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1.15rem;
  color: #fff;
}

.bg-indigo { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.bg-emerald { background: linear-gradient(135deg, #10B981, #059669); }
.bg-amber { background: linear-gradient(135deg, #F59E0B, #D97706); }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ==================== TABLES ==================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.87rem;
}

.data-table th {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ==================== FILTER BAR & STUDENT CARDS ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input-wrap input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  transition: var(--transition);
}

.search-input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-select-wrap {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select-wrap select {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #111827;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select-wrap select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Student Cards Grid */
.student-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.student-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.student-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.avatar-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4338CA, #6366F1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.student-meta h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.student-meta .nim-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  display: inline-block;
  margin-top: 0.15rem;
}

.student-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.83rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.detail-label {
  color: var(--text-muted);
}

.detail-val {
  font-weight: 600;
  text-align: right;
}

.pill-ipk {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.matkul-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.matkul-tag {
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.student-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ==================== KNOWLEDGE GRAPH VIEWPORT ==================== */
.graph-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.graph-viewport-card {
  background: #0D121F;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.graph-legend {
  display: flex;
  gap: 1.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(17, 24, 39, 0.85);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.node-mahasiswa { background: #6366F1; box-shadow: 0 0 6px #6366F1; }
.node-dosen { background: #10B981; box-shadow: 0 0 6px #10B981; }
.node-prodi { background: #F59E0B; box-shadow: 0 0 6px #F59E0B; }
.node-matkul { background: #38BDF8; box-shadow: 0 0 6px #38BDF8; }

#knowledgeGraphCanvas {
  width: 100%;
  height: 520px;
  background: radial-gradient(circle at center, #111827 0%, #0B0F19 100%);
  border-radius: var(--radius-md);
  cursor: grab;
}

#knowledgeGraphCanvas:active {
  cursor: grabbing;
}

.graph-instructions {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

.graph-inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.inspector-header i {
  color: var(--accent-cyan);
}

.inspector-content {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.5;
}

.inspector-node-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.inspector-table {
  width: 100%;
  margin-top: 1rem;
  font-size: 0.82rem;
  border-collapse: collapse;
}

.inspector-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inspector-table td.key {
  color: var(--text-muted);
  width: 38%;
  font-weight: 500;
}

.inspector-table td.val {
  color: #fff;
  font-weight: 600;
}

/* ==================== SPARQL PLAYGROUND ==================== */
.sparql-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.preset-select {
  padding: 0.65rem 1rem;
  background: #111827;
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 280px;
}

.preset-select:focus {
  outline: none;
  border-color: var(--primary);
}

.editor-card, .results-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.editor-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-editor {
  width: 100%;
  background: #070A11;
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  resize: vertical;
  min-height: 280px;
  margin: 1rem 0;
  tab-size: 2;
}

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

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.runtime-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.results-scroll {
  max-height: 380px;
  overflow-y: auto;
  margin-top: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* ==================== ONTOLOGY VIEWER ==================== */
.ontology-tree {
  background: #080C16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.85rem;
}

.tree-item {
  padding: 0.4rem 0;
}

.tree-children {
  margin-left: 1.5rem;
  padding-left: 0.75rem;
  border-left: 1px dashed rgba(255, 255, 255, 0.15);
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tree-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.class-badge { background: #4338CA; color: #EEF2FF; }
.prop-d { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.prop-o { background: rgba(16, 185, 129, 0.15); color: #34D399; }

.raw-code-box {
  background: #070A11;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #A5B4FC;
  overflow-x: auto;
  max-height: 460px;
  line-height: 1.6;
}

/* ==================== PROJECT SUMMARY & QUESTIONNAIRE ==================== */
.project-summary-box {
  font-size: 0.88rem;
  line-height: 1.65;
}

.project-summary-box h4 {
  font-size: 1rem;
  color: #E2E8F0;
  margin-bottom: 0.5rem;
}

.project-summary-box ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-summary-box li {
  margin-bottom: 0.35rem;
}

.role-table-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.role-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.admin-tag { background: rgba(244, 63, 94, 0.15); color: #FB7185; }
.user-tag { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }

.copyable-text-area {
  display: none;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #070A11;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.12) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.login-container {
  width: 100%;
  max-width: 480px;
  animation: fadeIn 0.4s ease forwards;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-circle {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
  margin-bottom: 0.85rem;
}

.login-brand-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-brand-header h2 span {
  background: linear-gradient(90deg, #A5B4FC, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.login-card {
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

.login-card-header {
  margin-bottom: 1.5rem;
}

.login-card-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #F9FAFB;
}

.login-error-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #FB7185;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 2.75rem;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.btn-toggle-password:hover {
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
}

.quick-login-divider {
  position: relative;
  text-align: center;
  margin: 1.75rem 0 1.25rem;
}

.quick-login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.quick-login-divider span {
  position: relative;
  background: #111827;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.quick-login-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-quick-login {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-main);
  text-align: left;
}

.btn-quick-login:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.quick-role-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-creds {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.login-team-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.team-footer-title {
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 0.4rem;
}

.team-footer-members {
  line-height: 1.5;
  color: #9CA3AF;
}

.team-table th {
  background: rgba(99, 102, 241, 0.1);
  color: #E0E7FF;
}

.team-table td {
  padding: 0.85rem 1rem;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-form {
  padding: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.triple-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.triple-pred { color: #38BDF8; }
.triple-obj { color: #34D399; font-weight: 500; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #1F2937;
  color: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  animation: slideToast 0.3s ease;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.5); background: #064E3B; }
.toast.toast-info { border-color: rgba(56, 189, 248, 0.5); background: #0C4A6E; }
.toast.toast-danger { border-color: rgba(244, 63, 94, 0.5); background: #881337; }

@keyframes slideToast {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== FOOTER ==================== */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  background: var(--bg-header);
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-badge {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==================== ADVANCED RESPONSIVE DESIGN ==================== */
@media (max-width: 1080px) {
  .hero-banner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem;
  }
  .grid-2, .grid-3, .graph-layout, .sparql-grid {
    grid-template-columns: 1fr;
  }
  #knowledgeGraphCanvas {
    height: 460px;
  }
}

@media (max-width: 860px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .brand-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .mobile-nav-toggle-wrap {
    display: flex;
  }
  .mobile-hamburger {
    display: flex;
  }
  .desktop-auth-box {
    display: none;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open {
    display: flex;
    animation: fadeIn 0.25s ease forwards;
  }
  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    justify-content: flex-start;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .header-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .header-actions .btn {
    flex: 1;
    min-width: 140px;
  }
  .sparql-actions, .preset-select {
    width: 100%;
  }
  .preset-select {
    min-width: 100%;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem 0.85rem;
  }
  .hero-banner {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }
  .hero-text h2 {
    font-size: 1.35rem;
    line-height: 1.3;
  }
  .hero-text p {
    font-size: 0.86rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-box {
    padding: 0.75rem;
  }
  .stat-number {
    font-size: 1.5rem;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.75rem;
  }
  .search-input-wrap {
    min-width: 100%;
    width: 100%;
  }
  .filter-select-wrap {
    width: 100%;
    flex-direction: column;
  }
  .filter-select-wrap select, .filter-select-wrap .btn {
    width: 100%;
  }
  .student-cards-grid {
    grid-template-columns: 1fr;
  }
  #knowledgeGraphCanvas {
    height: 360px;
  }
  .graph-legend {
    font-size: 0.7rem;
    gap: 0.65rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .modal-card {
    border-radius: var(--radius-lg);
    max-height: 90vh;
  }
  .modal-header, .modal-form, .modal-footer {
    padding: 1rem;
  }
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .modal-footer .actions {
    display: flex;
    gap: 0.5rem;
  }
  .modal-footer .actions .btn {
    flex: 1;
  }
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .toast {
    width: 100%;
  }
  .editor-buttons {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }
  .editor-buttons .btn {
    flex: 1;
  }
  .card-header.flex-between {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .brand-logo {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .brand-info h1 {
    font-size: 1rem;
  }
  .brand-info p {
    font-size: 0.65rem;
  }
  .stat-number {
    font-size: 1.3rem;
  }
  .student-card {
    padding: 1rem;
  }
}
