/* ============================================================================
   shell.css — Unified stylesheet for Flanders Portales (docs, help, induction)
   Matches the premium look & feel of the Flanders Design System (BRAND.md)
   ============================================================================ */

/* Theme variables fallback if not defined by the page */
:root {
  --fl-font: 'Geist', system-ui, -apple-system, sans-serif;
  --fl-violet: #7a6cff;
  --fl-violet-hover: #6457e6;
  --fl-cta: #2563eb;
  --fl-cta-hover: #1d4ed8;
  --fl-bg-light: #ffffff;
  --fl-bg-dark: #0a0a0a;
  --fl-surface-light: #f9fafb;
  --fl-surface-dark: #111827;
  --fl-border-light: #e5e7eb;
  --fl-border-dark: #374151;
  --fl-text-light: #171717;
  --fl-text-dark: #ededed;
  --fl-text-secondary-light: #6b7280;
  --fl-text-secondary-dark: #9ca3af;
  --fl-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --fl-backdrop: rgba(10, 10, 10, 0.7);
}

/* Loading & Login Screens Wrapper */
.fl-overlay-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fl-font);
  background: var(--fl-bg-light);
  color: var(--fl-text-light);
  transition: opacity 0.3s ease;
}

html[data-theme="dark"] .fl-overlay-container {
  background: var(--fl-bg-dark);
  color: var(--fl-text-dark);
}

/* Loading Screen */
.fl-loading-content {
  text-align: center;
}

.fl-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--fl-border-light);
  border-top-color: var(--fl-violet);
  border-radius: 50%;
  animation: fl-spin 1s linear infinite;
  margin: 0 auto 16px;
}

html[data-theme="dark"] .fl-spinner {
  border-color: var(--fl-border-dark);
  border-top-color: var(--fl-violet);
}

@keyframes fl-spin {
  to { transform: rotate(360deg); }
}

/* Login Card style */
.fl-login-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--fl-border-light);
  box-shadow: var(--fl-shadow);
  text-align: center;
  animation: fl-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .fl-login-card {
  background: var(--fl-surface-dark);
  border-color: var(--fl-border-dark);
}

@keyframes fl-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fl-logo-glow {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: conic-gradient(from 210deg, #e52862, #7a6cff, #43bdde, #32cc7e, #ffac48, #e52862);
  box-shadow: 0 0 16px rgba(122, 108, 255, 0.4);
  margin: 0 auto 24px;
}

.fl-login-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.fl-login-card p {
  font-size: 14px;
  color: var(--fl-text-secondary-light);
  margin: 0 0 24px;
}

html[data-theme="dark"] .fl-login-card p {
  color: var(--fl-text-secondary-dark);
}

/* Google Sign-in Button */
.fl-btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--fl-border-light);
  background: #ffffff;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

html[data-theme="dark"] .fl-btn-google {
  background: #111827;
  border-color: var(--fl-border-dark);
  color: #ededed;
}

.fl-btn-google:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

html[data-theme="dark"] .fl-btn-google:hover {
  background: #1f2937;
}

.fl-btn-google svg {
  width: 18px;
  height: 18px;
}

/* Blocked screen (e.g. Induction Core Team gate) */
.fl-blocked-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #fee2e2;
  box-shadow: var(--fl-shadow);
  text-align: center;
  animation: fl-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .fl-blocked-card {
  background: var(--fl-surface-dark);
  border-color: #7f1d1d;
}

.fl-blocked-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #dc2626;
  margin: 0 0 12px;
}

html[data-theme="dark"] .fl-blocked-card h2 {
  color: #f87171;
}

/* Context selector drop-down in topbar */
.fl-context-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  margin-left: 16px;
}

.fl-context-picker:hover {
  background: var(--border);
}

.fl-context-picker .arrow {
  margin-left: 8px;
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.fl-context-picker.open .arrow {
  transform: rotate(180deg);
}

.fl-context-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  padding: 8px;
  display: none;
}

.fl-context-menu.show {
  display: block;
}

.fl-context-menu-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 8px;
  letter-spacing: 0.05em;
}

.fl-context-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fl-context-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.fl-context-item.active {
  color: var(--violet);
  background: color-mix(in srgb, var(--violet) 8%, transparent);
  font-weight: 700;
}

/* User avatar button / menu */
.fl-user-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: 8px;
}

.fl-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fl-violet);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease;
}

.fl-user-profile:hover .fl-avatar {
  border-color: var(--fl-violet);
}

.fl-user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  padding: 8px;
  display: none;
}

.fl-user-menu.show {
  display: block;
}

.fl-user-info {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.fl-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fl-user-email {
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fl-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fl-menu-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.fl-menu-btn.logout-btn {
  color: var(--error);
}

.fl-menu-btn.logout-btn:hover {
  background: color-mix(in srgb, var(--error) 8%, transparent);
}
