/* ============================================
   CampusLine — Sovereign Design System
   Premium Glassmorphism + Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* -----------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   ----------------------------------------------- */
:root {
  /* Core Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Accent Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #06d6a0 100%);
  --gradient-info: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --gradient-hero: linear-gradient(160deg, #0a0e1a 0%, #1a1040 30%, #0f172a 60%, #0a0e1a 100%);
  --gradient-card-border: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.2), rgba(245, 158, 11, 0.3));
  --gradient-text: linear-gradient(135deg, #c084fc, #818cf8, #60a5fa);
  --gradient-gold: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b);

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;

  /* Semantic Colors */
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-secondary: #8b5cf6;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Border */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --shadow-glow-accent: 0 0 30px rgba(245, 158, 11, 0.15);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
}

/* -----------------------------------------------
   2. Reset & Base
   ----------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-accent);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
  color: inherit;
}

/* -----------------------------------------------
   3. Typography
   ----------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--text-accent);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* -----------------------------------------------
   4. Layout
   ----------------------------------------------- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

/* -----------------------------------------------
   5. Glass Card Component
   ----------------------------------------------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.card-accent {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-md);
  background: var(--gradient-primary);
  color: white;
}

.card-icon.accent {
  background: var(--gradient-accent);
}

.card-icon.success {
  background: var(--gradient-success);
}

.card-icon.info {
  background: var(--gradient-info);
}

/* -----------------------------------------------
   6. Buttons
   ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.5);
}

.btn-glass {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-light);
  border: 1px solid var(--color-primary);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.6rem;
  border-radius: var(--radius-md);
}

/* -----------------------------------------------
   7. Input / Form
   ----------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

/* -----------------------------------------------
   8. Badge / Tag
   ----------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* -----------------------------------------------
   9. Sidebar Navigation
   ----------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-logo h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-primary-light);
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-profile:hover {
  background: var(--bg-glass-hover);
}

.sidebar-profile .avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-profile .profile-info {
  flex: 1;
  min-width: 0;
}

.sidebar-profile .profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile .profile-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

/* -----------------------------------------------
   10. Page Header
   ----------------------------------------------- */
.page-header {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header h1 {
  font-size: 1.75rem;
}

.page-header .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-body {
  padding: var(--space-xl);
}

/* -----------------------------------------------
   11. Status Reel / Progress
   ----------------------------------------------- */
.status-reel {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
}

.status-step {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-step.completed {
  color: var(--color-success);
}

.status-step.active {
  color: var(--color-primary-light);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  position: relative;
}

.status-step.completed .status-dot {
  background: var(--color-success);
}

.status-step.active .status-dot {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
  animation: pulse-dot 2s infinite;
}

.status-connector {
  width: 30px;
  height: 2px;
  background: var(--border-subtle);
}

.status-step.completed+.status-connector,
.status-connector.completed {
  background: var(--color-success);
}

/* -----------------------------------------------
   12. Avatar / Stories Bar
   ----------------------------------------------- */
.stories-bar {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  flex-shrink: 0;
}

.story-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2px;
  background: var(--gradient-primary);
}

.story-avatar img,
.story-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  object-fit: cover;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.story-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------------------------
   13. Post Card (Feed)
   ----------------------------------------------- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.post-card:hover {
  border-color: var(--border-glass);
}

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: white;
}

.post-meta {
  flex: 1;
}

.post-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.post-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-body {
  padding: 0 var(--space-md) var(--space-md);
}

.post-body p {
  font-size: 0.92rem;
  line-height: 1.6;
}

.post-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.post-actions {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.post-action-btn:hover {
  color: var(--color-primary-light);
  background: var(--bg-glass);
}

.post-action-btn.liked {
  color: var(--color-danger);
}

/* -----------------------------------------------
   14. Chat / AI Assistant
   ----------------------------------------------- */
.chat-container {
  display: flex;
  height: calc(100vh - 70px);
}

.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 26, 0.5);
}

.chat-sidebar-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-bottom: 2px;
}

.chat-list-item:hover,
.chat-list-item.active {
  background: var(--bg-glass-hover);
}

.chat-list-item .chat-preview {
  flex: 1;
  min-width: 0;
}

.chat-list-item .chat-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item .chat-snippet {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-message {
  display: flex;
  gap: var(--space-sm);
  max-width: 80%;
  animation: fadeSlideUp 0.3s ease;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  line-height: 1.6;
}

.chat-message.ai .chat-bubble {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-top-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: var(--gradient-primary);
  color: white;
  border-top-right-radius: 4px;
}

.chat-bubble .source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-glass);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.chat-input-area {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 14, 26, 0.5);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--color-primary);
}

.chat-input-wrapper textarea {
  flex: 1;
  resize: none;
  padding: var(--space-sm) 0;
  font-size: 0.92rem;
  max-height: 120px;
  line-height: 1.5;
}

.chat-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.suggestion-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--border-accent);
  color: var(--color-primary-light);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-md);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* -----------------------------------------------
   15. Progress Ring
   ----------------------------------------------- */
.progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.progress-ring .bg-ring {
  stroke: var(--border-subtle);
}

.progress-ring .fg-ring {
  stroke: url(#progressGradient);
  transition: stroke-dashoffset var(--transition-slow);
}

.progress-ring .progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* -----------------------------------------------
   16. Tabs
   ----------------------------------------------- */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  background: none;
  border: none;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-card);
  color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

/* -----------------------------------------------
   17. Modal
   ----------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 500px;
  width: 90%;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-spring);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* -----------------------------------------------
   18. Toast Notifications
   ----------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  animation: slideInRight 0.4s ease;
  min-width: 280px;
}

.toast.success {
  border-left: 3px solid var(--color-success);
}

.toast.error {
  border-left: 3px solid var(--color-danger);
}

.toast.warning {
  border-left: 3px solid var(--color-warning);
}

/* -----------------------------------------------
   19. Exam Card
   ----------------------------------------------- */
.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.exam-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.exam-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.exam-card:hover::after {
  opacity: 1;
}

.exam-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.exam-board-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: white;
}

.exam-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.exam-detail-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.exam-detail-row .icon {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}

/* -----------------------------------------------
   20. Startup Card
   ----------------------------------------------- */
.startup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.startup-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.startup-card-banner {
  height: 120px;
  background: var(--gradient-primary);
  position: relative;
}

.startup-card-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 2px solid var(--bg-primary);
  position: absolute;
  bottom: -28px;
  left: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.startup-card-body {
  padding: calc(var(--space-xl) + 12px) var(--space-lg) var(--space-lg);
}

.star-rating {
  display: flex;
  gap: 2px;
}

.star-rating .star {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.star-rating .star.filled {
  color: #fbbf24;
}

/* -----------------------------------------------
   21. Document Checklist
   ----------------------------------------------- */
.doc-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.doc-item:hover {
  border-color: var(--border-accent);
}

.doc-check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-check.checked {
  background: var(--gradient-success);
  border-color: var(--color-success);
}

.doc-info {
  flex: 1;
}

.doc-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.doc-specs {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* -----------------------------------------------
   22. Hero Section (Landing)
   ----------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  top: 10%;
  left: -10%;
  animation: floatOrb 20s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  bottom: 5%;
  right: -5%;
  animation: floatOrb 25s ease-in-out infinite reverse;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--space-xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary-light);
  margin-bottom: var(--space-xl);
  animation: fadeSlideUp 0.6s ease;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: var(--space-lg);
  animation: fadeSlideUp 0.8s ease 0.1s both;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  animation: fadeSlideUp 0.8s ease 0.2s both;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.8s ease 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  animation: fadeSlideUp 0.8s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  font-family: var(--font-heading);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* -----------------------------------------------
   23. Ticker / Marquee
   ----------------------------------------------- */
.ticker-wrapper {
  overflow: hidden;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.ticker-track {
  display: flex;
  gap: var(--space-2xl);
  animation: ticker 30s linear infinite;
  width: max-content;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-item .ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* -----------------------------------------------
   24. Auth Split Screen
   ----------------------------------------------- */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-branding {
  background: var(--gradient-hero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  top: 20%;
  right: -20%;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  background: var(--bg-secondary);
}

.auth-form-box {
  width: 100%;
  max-width: 420px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.oauth-btn:hover {
  border-color: var(--border-accent);
  background: var(--bg-glass-hover);
}

.oauth-btn-google {
  position: relative;
  transition: all var(--transition-base);
}

.oauth-btn-google:hover {
  border-color: rgba(66, 133, 244, 0.5);
  background: rgba(66, 133, 244, 0.08);
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.1);
}

.oauth-btn-google svg {
  flex-shrink: 0;
}

.oauth-btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

.oauth-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #4285F4;
  border-radius: 50%;
  animation: oauthSpin 0.6s linear infinite;
}

@keyframes oauthSpin {
  to {
    transform: rotate(360deg);
  }
}

/* -----------------------------------------------
   25. Animations & Keyframes
   ----------------------------------------------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0.4);
  }

  50% {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
  }
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(15px, 10px) scale(1.02);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-8px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
  }

  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* -----------------------------------------------
   26. Scrollbar
   ----------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* -----------------------------------------------
   27. Responsive
   ----------------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-branding {
    display: none;
  }

  .chat-sidebar {
    display: none;
  }

  .page-header {
    padding: var(--space-lg);
  }

  .page-body {
    padding: var(--space-md);
  }

  .container {
    padding: 0 var(--space-md);
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-md);
  }

  .status-reel {
    flex-wrap: wrap;
  }
}

/* -----------------------------------------------
   28. 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;
}

.animate-in {
  animation: fadeSlideUp 0.5s ease both;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-card-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w-full {
  width: 100%;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}