/**
 * DUSA Knowledge Portal - Stylesheet
 * Dark theme with red accents, star particles, premium feel
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Core Colors - DUSA Brand */
  --color-bg-primary: #0a0a0b;
  --color-bg-secondary: #111113;
  --color-bg-tertiary: #18181b;
  --color-bg-elevated: #1f1f23;
  --color-bg-hover: #27272a;

  /* Accent Colors */
  --color-accent: #dc2626;
  --color-accent-hover: #ef4444;
  --color-accent-muted: rgba(220, 38, 38, 0.15);
  --color-accent-glow: rgba(220, 38, 38, 0.4);

  /* Text Colors */
  --color-text-primary: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-text-inverse: #0a0a0b;

  /* Border Colors */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  --color-border-accent: rgba(220, 38, 38, 0.5);

  /* Status Colors */
  --color-success: #22c55e;
  --color-success-muted: rgba(34, 197, 94, 0.15);
  --color-warning: #f59e0b;
  --color-warning-muted: rgba(245, 158, 11, 0.15);
  --color-error: #ef4444;
  --color-error-muted: rgba(239, 68, 68, 0.15);
  --color-info: #3b82f6;
  --color-info-muted: rgba(59, 130, 246, 0.15);

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  --gradient-glow: radial-gradient(ellipse at center, var(--color-accent-glow) 0%, transparent 70%);

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px var(--color-accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--color-accent);
  color: white;
}

/* ============================================
   Starfield Canvas Background
   ============================================ */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Floating Gradient Orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--color-accent);
  top: -200px;
  right: -200px;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #7c3aed;
  bottom: -100px;
  left: -100px;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #0ea5e9;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat3 30s ease-in-out infinite;
  opacity: 0.2;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, 30px) scale(1.1); }
  66% { transform: translate(30px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(0.9); }
  66% { transform: translate(-30px, 40px) scale(1.05); }
}

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

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  position: relative;
  width: 80px;
  height: 80px;
}

.loader-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: loaderSpin 1.2s linear infinite;
}

.loader-ring:nth-child(2) {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  border-top-color: var(--color-text-muted);
  animation-duration: 1s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  width: 40%;
  height: 40%;
  top: 30%;
  left: 30%;
  border-top-color: var(--color-accent);
  animation-duration: 0.8s;
}

.loader-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes logoPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.loader-text {
  margin-top: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================
   Auth Container (Login/Register)
   ============================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Navigation Bar */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.status-text {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Auth Wrapper */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  position: relative;
  animation: cardSlideUp 0.5s ease-out;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

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

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

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

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

.input-icon {
  position: absolute;
  left: var(--space-md);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  padding-left: calc(var(--space-md) + 18px + var(--space-md));
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
  color: var(--color-accent);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.password-toggle {
  position: absolute;
  right: var(--space-md);
  background: none;
  border: none;
  padding: var(--space-xs);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

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

.eye-icon {
  width: 18px;
  height: 18px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-md), 0 0 20px var(--color-accent-muted);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

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

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

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

.btn-success:hover {
  background: #16a34a;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
}

.btn-icon {
  padding: var(--space-sm);
  aspect-ratio: 1;
}

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.nav-item.active {
  background: var(--color-accent-muted);
  color: var(--color-accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

.nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

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

.user-name {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.logout-btn {
  background: none;
  border: none;
  padding: var(--space-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-error);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Content Header */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: var(--space-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.mobile-menu-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: var(--space-md);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input {
  width: 280px;
  padding: var(--space-sm) var(--space-md);
  padding-left: calc(var(--space-md) + 18px + var(--space-sm));
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  width: 320px;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-xl);
}

.page {
  animation: pageIn 0.3s ease-out;
}

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

.page-intro {
  margin-bottom: var(--space-xl);
}

.page-intro h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.page-intro p {
  color: var(--color-text-secondary);
  max-width: 600px;
}

/* ============================================
   Form Components
   ============================================ */
.form-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.form-card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

.form-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.form-card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.form-select {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  background-size: 18px;
  padding-right: calc(var(--space-md) + 24px);
}

.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.form-select option {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 120px;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ============================================
   Cards & Lists
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
  background: var(--color-bg-secondary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Submission Card */
.submission-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-fast);
}

.submission-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.submission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.submission-product {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.submission-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.submission-status.pending {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.submission-status.approved {
  background: var(--color-success-muted);
  color: var(--color-success);
}

.submission-status.rejected {
  background: var(--color-error-muted);
  color: var(--color-error);
}

.submission-question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.submission-solution {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.submission-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.submission-actions {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

/* FAQ Filters */
.faq-filters {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.faq-filters .form-select,
.faq-filters .form-input {
  flex: 1;
  max-width: 300px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 480px;
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  animation: toastOut 0.3s ease-out forwards;
}

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

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

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-error); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon { color: var(--color-info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.toast-close {
  background: none;
  border: none;
  padding: var(--space-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Modal
   ============================================ */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--space-2xl) * 2);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s ease-out;
}

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

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  padding: var(--space-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* ============================================
   User Management
   ============================================ */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  transition: all var(--transition-fast);
}

.user-card:hover {
  border-color: var(--color-border-hover);
}

.user-card .user-avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.user-card .user-info {
  flex: 1;
}

.user-card .user-name {
  font-size: 0.9375rem;
}

.user-card .user-email {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.user-card .user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-card .user-role-badge.admin {
  background: var(--color-accent-muted);
  color: var(--color-accent);
}

.user-card .user-role-badge.member {
  background: var(--color-info-muted);
  color: var(--color-info);
}

.user-card .user-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .search-input {
    width: 200px;
  }

  .search-input:focus {
    width: 240px;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 24px;
    --space-2xl: 32px;
  }

  .auth-card {
    padding: var(--space-xl);
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .header-right {
    display: none;
  }

  .page-content {
    padding: var(--space-md);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .faq-filters {
    flex-direction: column;
  }

  .faq-filters .form-select,
  .faq-filters .form-input {
    max-width: none;
  }

  .submission-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .submission-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .submission-actions {
    margin-left: 0;
    width: 100%;
  }

  .submission-actions .btn {
    flex: 1;
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: var(--space-md);
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .nav {
    padding: var(--space-md);
  }

  .nav-status {
    display: none;
  }
}

/* ============================================
   Auth Contact Note
   ============================================ */
.auth-contact-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  padding: var(--space-sm) 0;
}

/* ============================================
   Guide Card (FAQ Submission Help)
   ============================================ */
.guide-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.guide-header svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.guide-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.guide-content {
  padding: var(--space-lg);
}

.guide-content > p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.guide-section {
  margin-top: var(--space-lg);
}

.guide-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-list li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.guide-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
}

.guide-list li strong {
  color: var(--color-text-primary);
}

/* Example Cards */
.example-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.example-card:last-child {
  margin-bottom: 0;
}

.example-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.example-field {
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.example-field .field-label {
  font-weight: 500;
  color: var(--color-text-primary);
  margin-right: var(--space-sm);
}

.example-field code {
  background: var(--color-bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
}

.example-field em {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================
   Create User Card
   ============================================ */
.create-user-card {
  margin-bottom: var(--space-xl);
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

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

/* Section Title */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

/* ============================================
   Info Card (Train AI Page)
   ============================================ */
.info-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.info-card-accent {
  border-left: 4px solid var(--color-accent);
}

.info-card-icon {
  flex-shrink: 0;
}

.info-card-icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-accent);
}

.info-card-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

.info-card-content p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ============================================
   Form Row 2 Column
   ============================================ */
.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Knowledge List & Filters
   ============================================ */
.knowledge-filters {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.knowledge-filters .form-select {
  max-width: 200px;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.knowledge-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.knowledge-card:hover {
  border-color: var(--color-border-hover);
}

.knowledge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.knowledge-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.knowledge-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.knowledge-card-type {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent-muted);
  color: var(--color-accent);
  text-transform: uppercase;
}

.knowledge-card-type.core_concept { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.knowledge-card-type.feature { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.knowledge-card-type.theme { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.knowledge-card-type.restriction { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.knowledge-card-type.integration { background: rgba(236, 72, 153, 0.15); color: #f472b6; }

.knowledge-card-priority {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.knowledge-card-priority svg {
  width: 14px;
  height: 14px;
}

.knowledge-card-body {
  padding: var(--space-lg);
}

.knowledge-card-product {
  font-size: 0.8125rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.knowledge-card-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  max-height: 150px;
  overflow: hidden;
  position: relative;
}

.knowledge-card-content.expanded {
  max-height: none;
}

.knowledge-card-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--color-bg-secondary));
  pointer-events: none;
}

.knowledge-card-content.expanded::after {
  display: none;
}

.knowledge-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-tertiary);
  border-top: 1px solid var(--color-border);
}

.knowledge-card-date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.knowledge-card-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-hover) var(--color-bg-tertiary);
}
