/* ==========================================================================
   EWU Faculty & Course Section Explorer - Modern Design System
   ========================================================================== */

:root,
body.dark-theme {
  /* Color Palette - Dark Mode (Default) */
  --bg-main: #0b0f17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --bg-card-solid: #121826;
  --bg-input: #0f172a;
  --bg-subtle: #1e293b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-light: rgba(255, 255, 255, 0.05);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Accents & Brand */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;

  /* Status Colors */
  --status-open-bg: rgba(16, 185, 129, 0.15);
  --status-open-text: #34d399;
  --status-open-border: rgba(52, 211, 153, 0.3);

  --status-full-bg: rgba(239, 68, 68, 0.15);
  --status-full-text: #f87171;
  --status-full-border: rgba(248, 113, 113, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

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

/* Light Theme Variables */
body.light-theme {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #e2e8f0;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;
  --border-light: rgba(0, 0, 0, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.12);

  --status-open-bg: #ecfdf5;
  --status-open-text: #059669;
  --status-open-border: #a7f3d0;

  --status-full-bg: #fef2f2;
  --status-full-text: #dc2626;
  --status-full-border: #fecaca;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Promotion Banner for EWU-Toolkit
   ========================================================================== */
.promo-banner {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 40%, #1e3a8a 100%);
  border-bottom: 1px solid rgba(129, 140, 248, 0.3);
  padding: 10px 20px;
  position: relative;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.promo-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.promo-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e0e7ff;
  font-size: 0.925rem;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(165, 180, 252, 0.4);
  color: #c7d2fe;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.promo-badge .icon-sparkle {
  animation: pulse-spin 3s infinite linear;
}

@keyframes pulse-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.promo-text strong {
  color: #ffffff;
}

.btn-promo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1e1b4b;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-promo:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
  color: #4338ca;
}

.promo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-promo-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c7d2fe;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
}

.btn-promo-dismiss.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.btn-promo-dismiss:not(.disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.btn-promo-dismiss:not(.disabled):hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(248, 113, 113, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.semester-tag {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Profile Nav */
.user-profile-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--primary);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email-badge {
  font-size: 0.675rem;
  color: #34d399;
  font-family: var(--font-mono);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.775rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Login Gate Screen
   ========================================================================== */
.login-gate-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  max-width: 580px;
  margin: 40px auto;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  animation: modal-enter 0.3s ease;
}

.login-gate-glow {
  position: absolute;
  top: -60px;
  width: 250px;
  height: 120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
}

.login-gate-icon {
  width: 72px;
  height: 72px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.login-gate-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.login-gate-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.highlight-domain {
  color: #818cf8;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.login-domain-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 28px;
  max-width: 460px;
}

.login-domain-notice strong {
  color: #ffffff;
  text-decoration: underline;
}

.google-btn-wrapper {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.login-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 14px;
  max-width: 460px;
  animation: shake 0.4s ease;
}

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

.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: modal-enter 0.3s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-promo-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-promo-pdf:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}

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

.btn-icon {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--border-color);
  color: var(--primary);
}

.icon-refresh.spinning {
  animation: spin 1s infinite linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-blue-subtle { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.bg-green-subtle { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.bg-purple-subtle { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.bg-amber-subtle { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-value.text-md {
  font-size: 1.25rem;
}

.stat-refresh-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.stat-refresh-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fbbf24;
  display: block;
  margin-top: 2px;
}

.stat-subtext {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   Controls Card (Search & Filters)
   ========================================================================== */
.controls-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.search-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  transition: var(--transition);
}

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

.btn-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.btn-clear:hover {
  color: var(--text-primary);
}

.quick-export-actions {
  display: flex;
  gap: 10px;
}

/* Filters Row */
.filters-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1;
}

.filter-group label {
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.filter-group select {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Table Card & Dynamic Table
   ========================================================================== */
.table-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

/* Minimal Top Progress Bar */
.card-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(99, 102, 241, 0.12);
  overflow: hidden;
  z-index: 20;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.progress-bar-indicator {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, #6366f1 0%, #06b6d4 50%, #6366f1 100%);
  background-size: 200% 100%;
  border-radius: 9999px;
  animation: indeterminate-progress 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes indeterminate-progress {
  0% {
    left: -40%;
    width: 30%;
  }
  50% {
    left: 25%;
    width: 60%;
  }
  100% {
    left: 105%;
    width: 30%;
  }
}

.table-meta-bar {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.results-count-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.results-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.725rem;
  font-weight: 600;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  animation: modal-enter 0.15s ease;
}

.mini-spinner {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* Dimming during background population */
.table-populating {
  opacity: 0.52;
  pointer-events: none;
  filter: grayscale(12%);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.skeleton-table-row td {
  padding: 13px 14px;
}

.skeleton-cell-bar {
  height: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.active-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.chip, .filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
  font-size: 0.775rem;
  font-weight: 500;
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-full);
  line-height: 1.2;
  transition: all 0.2s ease;
  user-select: none;
}

.chip:hover, .filter-chip:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
}

.chip-label {
  display: inline-block;
  white-space: nowrap;
}

.chip-remove, .filter-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #c7d2fe;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.chip-remove:hover, .filter-chip button:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  transform: scale(1.1);
}

.chip-remove svg, .filter-chip button svg {
  display: block;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

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

.data-table th {
  background: var(--bg-subtle);
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.data-table th.sortable:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.sort-icon {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-left: 4px;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon {
  opacity: 1;
  color: var(--primary);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.text-center {
  text-align: center;
}

/* Course Code Badge */
.course-code-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #818cf8;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-badge {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.825rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Faculty Initial Chip */
.initial-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.775rem;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.initial-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.faculty-name-wrapper {
  display: flex;
  flex-direction: column;
}

.faculty-name {
  font-weight: 600;
  color: var(--text-primary);
}

.faculty-email-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.faculty-email-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Schedule Slots List */
.slots-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.slot-room-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* Seats Cell */
.seats-cell-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.seats-number {
  font-weight: 700;
  font-size: 0.9rem;
}

.seats-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-open {
  background: var(--status-open-bg);
  color: var(--status-open-text);
  border: 1px solid var(--status-open-border);
}

.badge-full {
  background: var(--status-full-bg);
  color: var(--status-full-text);
  border: 1px solid var(--status-full-border);
}

/* State Cell (Loading / Empty) */
.state-cell {
  text-align: center;
  padding: 50px 20px !important;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
  margin: 0 auto 16px;
}

/* Lazy Load Sentinel */
.lazy-load-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-top: 1px dashed var(--border-color);
  margin-top: 16px;
}

.lazy-load-sentinel.hidden {
  display: none !important;
}

.lazy-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

/* Action Button */
.btn-details {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-details:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   Pagination Bar
   ========================================================================== */
.pagination-bar {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-page:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
}

.btn-page.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 100;
  transition: opacity 0.2s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: min(90vh, 90dvh);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-group h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.modal-detail-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
}

.modal-detail-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.modal-detail-value {
  font-weight: 600;
  text-align: right;
  font-size: 0.9rem;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 120;
}

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  min-width: 280px;
}

.toast-success { border-left: 4px solid var(--status-open-text); }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-error { border-left: 4px solid var(--status-full-text); }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  text-align: center;
}

.footer-pdf-stats {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.pdf-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pdf-stats-badge .pdf-icon {
  color: #ef4444;
}

.pdf-stats-badge strong {
  color: #818cf8;
  font-weight: 700;
}

.footer-brand-line {
  font-weight: 600;
  color: var(--text-primary) !important;
  margin-bottom: 4px;
}

.footer-container p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-website-url {
  margin-top: 4px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.footer-website-url a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
  transition: var(--transition);
}

.footer-website-url a:hover {
  opacity: 1;
  text-decoration: underline;
  color: #a5b4fc;
}

.footer-subtext {
  margin-top: 6px;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.footer-subtext a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-subtext a:hover {
  text-decoration: underline;
}

.footer-credit {
  margin-top: 10px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.footer-credit a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #818cf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition);
}

.footer-credit a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.heart-icon {
  display: inline-block;
  animation: heart-beat 1.5s infinite ease-in-out;
  color: #ef4444;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

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

/* ==========================================================================
   View Mode Toggle & Mobile Hint
   ========================================================================== */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.btn-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-view-toggle:hover {
  color: var(--text-primary);
}

.btn-view-toggle.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.mobile-table-hint {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-size: 0.725rem;
  font-weight: 500;
  padding: 6px 14px;
}

/* ==========================================================================
   Responsive Cards Grid View (.cards-view-container)
   ========================================================================== */
.cards-view-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* 2+ blocks on larger devices */
@media (min-width: 640px) {
  .cards-view-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
  }
}

@media (min-width: 1024px) {
  .cards-view-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 20px;
  }
}

@media (min-width: 1536px) {
  .cards-view-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

.cards-view-container .state-cell {
  grid-column: 1 / -1;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
}

.card-course-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.card-seats-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.card-seats-pill {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.card-code {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #818cf8;
}

.card-sec {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.card-faculty-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  min-width: 0;
  width: 100%;
}

.card-faculty-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.card-faculty-name {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.card-faculty-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-faculty-email:hover {
  color: var(--primary);
  text-decoration: underline;
}

.card-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  min-width: 0;
  width: 100%;
}

.card-slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  min-width: 0;
  width: 100%;
}

.card-slot-time {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.card-slot-room {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.725rem;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  margin-top: auto;
  min-width: 0;
  width: 100%;
  gap: 8px;
}

.card-dept {
  color: var(--text-muted);
  font-size: 0.775rem;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-seats {
  font-weight: 600;
}

/* ==========================================================================
   Comprehensive Responsive Overhaul
   ========================================================================== */

/* Tablets (<= 1024px) */
@media (max-width: 1024px) {
  .nav-container,
  .main-content,
  .promo-container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Promo Banner */
  .promo-banner {
    padding: 8px 12px;
  }
  .promo-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .promo-content {
    font-size: 0.825rem;
    gap: 8px;
  }
  .promo-badge {
    font-size: 0.675rem;
    padding: 2px 6px;
    flex-shrink: 0;
  }
  .promo-text {
    line-height: 1.35;
  }
  .btn-promo {
    width: 100%;
    justify-content: center;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Navbar */
  .nav-container {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-logo svg {
    width: 22px;
    height: 22px;
  }

  .brand-title {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .semester-tag {
    font-size: 0.675rem;
    padding: 1px 6px;
  }

  .nav-actions {
    gap: 6px;
    margin-left: auto;
  }

  /* Hide long "Refresh Data" text on mobile, keep icon */
  #refreshBtnText {
    display: none;
  }

  #btnRefresh {
    padding: 6px 10px;
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    justify-content: center;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
  }

  /* Compact User Profile Nav on Mobile */
  .user-profile-nav {
    padding: 3px 8px 3px 4px;
    gap: 6px;
  }

  .user-avatar {
    width: 26px;
    height: 26px;
  }

  .user-name {
    max-width: 80px;
    font-size: 0.75rem;
  }

  .user-email-badge {
    display: none; /* Hide @std.ewubd.edu to save header width */
  }

  #btnSignOut {
    padding: 2px 8px;
    font-size: 0.7rem;
  }

  /* Main Container */
  .main-content {
    padding: 12px;
    gap: 14px;
  }

  /* Login Gate Card */
  .login-gate-card {
    padding: 28px 16px;
    margin: 16px 0;
    border-radius: var(--radius-md);
    max-width: 100%;
  }

  .login-gate-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
  }

  .login-gate-icon svg {
    width: 36px;
    height: 36px;
  }

  .login-gate-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .login-gate-subtitle {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
  }

  .login-domain-notice {
    padding: 10px 12px;
    font-size: 0.775rem;
    margin-bottom: 20px;
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  .google-btn-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Stats Grid: Clean 2x2 layout on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .stat-header {
    margin-bottom: 4px;
  }

  .stat-label {
    font-size: 0.725rem;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-subtext {
    font-size: 0.675rem;
  }

  /* Controls & Search */
  .controls-card {
    padding: 12px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .search-bar-row {
    flex-direction: column;
    gap: 8px;
  }

  .search-input-wrapper {
    width: 100%;
    min-width: 100%;
  }

  .search-input-wrapper input {
    padding: 10px 36px 10px 38px;
    font-size: 0.85rem;
  }

  .search-icon {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .quick-export-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .quick-export-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 7px 12px;
    font-size: 0.775rem;
  }

  /* 2-Column Grid for Filters on Mobile */
  .filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
  }

  .filter-group {
    min-width: 100%;
    gap: 4px;
  }

  .filter-group label {
    font-size: 0.675rem;
  }

  .filter-group select {
    padding: 7px 8px;
    font-size: 0.775rem;
    border-radius: var(--radius-sm);
  }

  .filter-reset-group {
    grid-column: span 2;
    text-align: center;
  }

  .btn-link {
    padding: 4px;
    font-size: 0.775rem;
  }

  /* Table Card on Mobile */
  .table-card {
    border-radius: var(--radius-md);
  }

  .table-meta-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .meta-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .results-count {
    font-size: 0.8rem;
  }

  .view-toggle-group {
    width: 100%;
    justify-content: center;
  }

  .btn-view-toggle {
    flex: 1;
    justify-content: center;
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .mobile-table-hint {
    display: flex;
  }

  /* Compact Table Cells on Mobile */
  .data-table th {
    padding: 8px 10px;
    font-size: 0.7rem;
  }

  .data-table td {
    padding: 8px 10px;
    font-size: 0.775rem;
  }

  .course-code-cell {
    font-size: 0.8rem;
    gap: 4px;
  }

  .sec-badge {
    font-size: 0.725rem;
    padding: 1px 5px;
  }

  .initial-chip {
    font-size: 0.7rem;
    padding: 2px 5px;
  }

  .faculty-name {
    font-size: 0.8rem;
  }

  .faculty-email-link {
    font-size: 0.7rem;
  }

  .slot-item {
    font-size: 0.725rem;
  }

  .slot-room-chip {
    font-size: 0.675rem;
    padding: 1px 4px;
  }

  .seats-number {
    font-size: 0.8rem;
  }

  .seats-subtext {
    font-size: 0.65rem;
  }

  .badge {
    font-size: 0.675rem;
    padding: 2px 6px;
  }

  .btn-details {
    padding: 2px 6px;
    font-size: 0.7rem;
  }

  /* Section Browser Cards on Mobile (No Overflow Guaranteed) */
  .cards-view-container {
    padding: 10px 8px;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .course-card {
    padding: 12px 10px;
    gap: 10px;
    border-radius: var(--radius-md);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .card-top-row {
    gap: 6px;
    width: 100%;
  }

  .card-code {
    font-size: 0.95rem;
  }

  .card-sec {
    font-size: 0.75rem;
    padding: 1px 6px;
  }

  .card-seats-wrapper {
    gap: 4px;
  }

  .card-seats-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .card-faculty-row {
    gap: 8px;
    padding-bottom: 8px;
  }

  .card-faculty-name {
    font-size: 0.875rem;
    line-height: 1.25;
  }

  .card-faculty-email {
    font-size: 0.7rem;
  }

  .card-schedule-list {
    gap: 5px;
  }

  .card-slot-item {
    font-size: 0.75rem;
    gap: 6px;
  }

  .card-slot-time {
    font-size: 0.75rem;
  }

  .card-slot-room {
    max-width: 46%;
    font-size: 0.675rem;
    padding: 1px 5px;
  }

  .card-footer-row {
    padding-top: 8px;
    gap: 6px;
  }

  .card-dept {
    font-size: 0.725rem;
  }

  /* Pagination Bar on Mobile */
  .pagination-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .pagination-info {
    font-size: 0.75rem;
    text-align: center;
  }

  .pagination-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .btn-page {
    min-width: 28px;
    height: 28px;
    font-size: 0.75rem;
    padding: 0 5px;
    border-radius: var(--radius-sm);
  }

  /* Details Modal on Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    overflow-y: hidden;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }

  .modal-title-group h3 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 16px;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: unset;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .modal-detail-row {
    padding-bottom: 8px;
  }

  .modal-detail-label {
    font-size: 0.775rem;
  }

  .modal-detail-value {
    font-size: 0.825rem;
  }

  .modal-footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    flex-direction: column-reverse;
    gap: 8px;
    flex-shrink: 0;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  /* Toast Notification on Mobile */
  .toast-container {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: unset;
    width: 100%;
    font-size: 0.8rem;
    padding: 10px 14px;
  }

  /* Footer on Mobile */
  .footer {
    padding: 16px 12px;
  }

  .footer-container p {
    font-size: 0.775rem;
  }

  .footer-subtext {
    font-size: 0.725rem;
  }

  .footer-credit {
    font-size: 0.75rem;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 0.925rem;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .user-name {
    max-width: 60px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .cards-view-container {
    padding: 8px 4px;
    gap: 8px;
  }

  .course-card {
    padding: 10px 8px;
    gap: 8px;
  }

  .card-code {
    font-size: 0.875rem;
  }

  .card-slot-room {
    max-width: 42%;
    font-size: 0.65rem;
  }

  .card-seats-pill {
    font-size: 0.65rem;
  }
}

.footer-dot {
  margin: 0 6px;
  color: var(--text-muted);
}

.admin-link-discreet {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.admin-link-discreet:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* ==========================================================================
   Navigation Bar Switcher Tabs (Sections vs Faculty)
   ========================================================================== */
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.nav-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab svg {
  flex-shrink: 0;
}

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

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

/* Mobile Sub-Navigation Bar inside Navbar */
.mobile-nav-subbar {
  display: none;
  border-top: 1px solid var(--border-light);
  padding: 6px 12px 8px;
  background: rgba(15, 23, 42, 0.4);
}

.mobile-nav-subbar .nav-switcher {
  display: flex;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px;
}

.mobile-nav-subbar .nav-switcher::-webkit-scrollbar {
  display: none;
}

.mobile-nav-subbar .nav-tab {
  flex-shrink: 0;
  justify-content: center;
  padding: 7px 14px;
  font-size: 0.825rem;
  gap: 6px;
}

@media (max-width: 900px) {
  .nav-switcher-desktop {
    display: none !important;
  }
  .mobile-nav-subbar {
    display: block;
  }
}

/* Faculty Info Quick Buttons in Section Explorer */
.btn-faculty-quick {
  padding: 5px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-faculty-quick:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-table-faculty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #a5b4fc;
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-table-faculty:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.faculty-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
  text-decoration: none;
  transition: var(--transition);
}

.faculty-profile-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   Faculty Directory Component Styles
   ========================================================================== */

/* Faculty Grid */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .faculty-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Faculty Card */
.faculty-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

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

/* Faculty Header */
.faculty-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.faculty-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  text-transform: uppercase;
  user-select: none;
}

.faculty-header-info {
  flex: 1;
  min-width: 0;
}

.faculty-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.faculty-name {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faculty-initial-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--primary);
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.faculty-designation {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

/* Meta Badges */
.faculty-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-dept {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-empid {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.badge-active-teaching {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--status-open-bg);
  color: var(--status-open-text);
  border: 1px solid var(--status-open-border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-not-teaching {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* Contact Action Buttons */
.faculty-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.btn-contact:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-contact.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Teaching Routine Section in Card */
.faculty-teaching-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teaching-preview-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.teaching-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teaching-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.teaching-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.teaching-chip-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.teaching-chip-status.open {
  background: #10b981;
}

.teaching-chip-status.full {
  background: #ef4444;
}

/* Card Footer */
.faculty-card-footer {
  padding-top: 4px;
}

.btn-view-profile {
  width: 100%;
  justify-content: center;
  font-size: 0.85rem;
  padding: 8px 14px;
}

/* Detailed Modal Specifics */
.modal-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.modal-profile-info {
  flex: 1;
}

.modal-profile-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.modal-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section-title svg {
  color: var(--primary);
}

.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 550px) {
  .modal-grid-2col {
    grid-template-columns: 1fr;
  }
}

.info-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.info-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.btn-icon-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-icon-copy:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
}

/* Teaching Routine List in Modal */
.modal-routine-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-routine-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-routine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.routine-course-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.routine-section-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.modal-routine-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.routine-detail-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Accordion */
.accordion-wrapper {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 8px;
}

.accordion-header {
  padding: 10px 14px;
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.accordion-header:hover {
  color: var(--text-primary);
}

.accordion-body {
  padding: 12px 14px;
  background: var(--bg-input);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-muted);
}

/* Faculty Initial Search Spotlight Card */
.initial-spotlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.initial-spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.initial-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-link-sm {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-link-sm:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.initial-spotlight-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.initial-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.initial-input-container .search-icon {
  position: absolute;
  left: 14px;
  color: var(--primary);
  pointer-events: none;
}

.initial-input-field {
  width: 100%;
  padding: 12px 42px 12px 42px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.initial-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.initial-quick-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.initial-chips-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
}

.initial-quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.initial-chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.initial-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.initial-chip-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* ==========================================================================
   CSS Loading Skeleton & Shimmer Effect
   ========================================================================== */
@keyframes cbShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: cbShimmer 1.8s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

body.light-theme .skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 25%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: cbShimmer 1.8s infinite ease-in-out;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.skeleton-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
}

.skeleton-line.title {
  width: 60%;
  height: 16px;
}

.skeleton-line.subtitle {
  width: 40%;
}

.skeleton-line.badge {
  width: 80px;
  height: 22px;
  border-radius: var(--radius-sm);
}

.skeleton-badges-row {
  display: flex;
  gap: 8px;
}

.skeleton-button-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.skeleton-btn {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Mobile Filter Toggle Pill & Count Badge
   ========================================================================== */
.mobile-filter-bar {
  display: none;
  align-items: center;
  margin-bottom: 10px;
}

.btn-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-pill:hover,
.btn-filter-pill[aria-expanded="true"] {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #ffffff;
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

@media (max-width: 768px) {
  .mobile-filter-bar {
    display: flex;
  }
  .filters-row.collapsed {
    display: none !important;
  }
}

/* ==========================================================================
   Simplified Initial Search Mode & Downloadable Profile Card
   ========================================================================== */
.initial-search-container {
  max-width: 540px;
  margin: 0 auto 32px;
  width: 100%;
}

.initial-search-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.initial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.initial-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.initial-search-box-wrap {
  width: 100%;
}

.initial-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.initial-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.initial-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.initial-query-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

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

.initial-query-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 400;
  text-transform: none;
  font-size: 0.9rem;
  letter-spacing: normal;
}

.btn-initial-submit {
  padding: 12px 20px;
  font-size: 0.925rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

/* Empty Prompt */
.initial-empty-prompt {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.initial-prompt-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.initial-empty-prompt h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.initial-empty-prompt p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* Single Profile Card Presentation */
.profile-card-canvas-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.single-profile-card {
  width: 100%;
  background: #0f172a;
  background: linear-gradient(145deg, #131b2e 0%, #0b0f19 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  color: #f8fafc;
}

.profile-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.profile-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-card-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

.profile-card-meta {
  flex: 1;
  min-width: 0;
}

.profile-card-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 4px;
  word-break: break-word;
}

.profile-card-designation {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 2px;
}

.profile-card-dept {
  font-size: 0.8rem;
  font-weight: 600;
  color: #818cf8;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
}

.profile-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.profile-detail-label {
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.profile-detail-value {
  color: #e2e8f0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-detail-value a {
  color: #818cf8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.profile-detail-value a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.btn-copy-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.btn-copy-sm:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
  border-color: #6366f1;
}

.profile-card-teaching {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 6px;
}

.profile-card-teaching-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.profile-card-watermark {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: #64748b;
}

.profile-card-watermark strong {
  color: #94a3b8;
}

/* Download Action Button */
.btn-download-card {
  width: 100%;
  padding: 12px 18px;
  font-size: 0.925rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}

.btn-download-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.btn-download-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==============================================================================
   Feedback Modal & Navbar Tab Styles
   ============================================================================== */
.nav-tab-feedback {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-card-feedback {
  max-width: 540px;
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.modal-title-with-icon h3 {
  color: var(--text-primary);
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.feedback-sender-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.feedback-sender-preview.anonymous-active {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.22);
}

.sender-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.feedback-sender-preview.anonymous-active .sender-preview-icon {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.sender-preview-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sender-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.sender-preview-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sender-preview-email {
  font-size: 0.775rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-control,
.feedback-category-select,
.feedback-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.feedback-category-select option {
  background: var(--bg-card-solid);
  color: var(--text-primary);
}

.feedback-category-select:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.field-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
}

.required-star {
  color: #ef4444;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.feedback-textarea {
  resize: vertical;
  min-height: 110px;
  max-height: 280px;
  line-height: 1.5;
}

.feedback-textarea::placeholder {
  color: var(--text-muted);
}

.feedback-anon-group {
  margin-top: 4px;
}

.feedback-anon-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  padding-left: 28px;
}

.feedback-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}

.feedback-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.feedback-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Initial Spotlight Form & Buttons */
.initial-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.initial-form-row .initial-input-container {
  flex: 1;
}

.btn-initial-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.925rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.initial-spotlight-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .initial-form-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-initial-search {
    width: 100%;
    justify-content: center;
  }
}




