@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/**
 * ==========================================================================
 * LINEUPLOGIC - MAIN STYLESHEET
 * ==========================================================================
 * This file contains the foundational styles, design tokens, CSS reset,
 * typography, layout system, animations, and utility classes.
 */

:root {
  /* ==========================================================================
     COLORS & THEME TOKENS
     ========================================================================== */
  
  /* Backgrounds */
  --color-bg: #09090b;          /* Deep space black */
  --color-bg-2: #18181b;        /* Card/surface background */
  --color-bg-3: #27272a;        /* Elevated surfaces */
  
  /* Borders */
  --color-border: #3f3f46; /* Subtle borders */
  --color-border-hover: #fafafa;
  
  /* Accents & Brand */
  --color-accent: #ffffff;      /* Electric violet */
  --color-accent-hover: #e4e4e7;
  --color-accent-active: #d4d4d8;
  --color-accent-2: #ffffff;    /* Neon cyan */
  --color-accent-2-hover: #0891b2;
  --color-accent-glow: transparent;
  --color-accent-2-glow: transparent;
  
  /* Typography */
  --color-text: #fafafa;        /* Primary text */
  --color-text-2: #a1a1aa;      /* Secondary text */
  --color-text-3: #475569;      /* Muted text */
  --color-text-inverse: #020617; /* Dark text on light background */
  
  /* Status & Feedback */
  --color-success: #10b981;     /* High confidence / Success */
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning: #f59e0b;     /* Medium confidence / Warning */
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-error: #ef4444;       /* Error / Disqualified */
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;        /* Informational */
  --color-info-bg: rgba(59, 130, 246, 0.1);
  
  /* Tier Badges */
  --color-tier-1: #7c3aed;      /* Tier 1 badge */
  --color-tier-2: #2563eb;      /* Tier 2 badge */
  --color-tier-3: #475569;      /* Tier 3 badge */
  
  /* ==========================================================================
     TYPOGRAPHY TOKENS
     ========================================================================== */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  --font-size-6xl: 3.75rem;     /* 60px */
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* ==========================================================================
     SPACING & LAYOUT TOKENS
     ========================================================================== */
  --spacing-px: 1px;
  --spacing-0: 0px;
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 24px;
  --spacing-6: 32px;
  --spacing-8: 48px;
  --spacing-10: 64px;
  --spacing-12: 96px;
  --spacing-16: 128px;
  
  --max-width-content: 1400px;
  --max-width-reading: 800px;
  --sidebar-width: 320px;
  --header-height: 72px;
  
  /* ==========================================================================
     BORDERS & RADIUS TOKENS
     ========================================================================== */
  --radius-none: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 28px;
  --radius-full: 0;
  
  /* ==========================================================================
     ELEVATION & Z-INDEX
     ========================================================================== */
  --z-negative: -1;
  --z-elevate: 1;
  --z-sticky: 100;
  --z-drawer: 200;
  --z-modal: 300;
  --z-popover: 400;
  --z-toast: 500;
  --z-tooltip: 600;
  
  /* Box Shadows */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: none;
  
  /* ==========================================================================
     TRANSITIONS
     ========================================================================== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/**
 * ==========================================================================
 * CSS RESET
 * ==========================================================================
 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-size: 16px;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.15) 0%, transparent 40%),
              radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
              var(--color-bg);
  background-attachment: fixed;
  animation: fadeIn 1s var(--transition-normal);
}

/* Remove list styles */
ul, ol {
  list-style: none;
}

/* Make media responsive */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove built-in form typography styles */
input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-bg-3);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-3);
}

/**
 * ==========================================================================
 * TYPOGRAPHY
 * ==========================================================================
 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--spacing-4);
}

h1 { font-size: var(--font-size-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-4xl); letter-spacing: -0.01em; }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  color: var(--color-text-2);
  margin-bottom: var(--spacing-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-2);
}

strong, b {
  font-weight: 600;
  color: var(--color-text);
}

small {
  font-size: var(--font-size-sm);
}

blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--spacing-4);
  margin-bottom: var(--spacing-4);
  font-style: italic;
  color: var(--color-text-2);
}

/**
 * ==========================================================================
 * ACCESSIBILITY
 * ==========================================================================
 */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/**
 * ==========================================================================
 * LAYOUT SYSTEM
 * ==========================================================================
 */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  background: rgba(7, 7, 15, 0.7);
  
  -webkit-
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--spacing-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-normal);
}

@supports not ( }
}

.nav__logo {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__logo::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--color-bg-2);
  border-radius: 50%;
  
}

.nav__links {
  display: flex;
  gap: var(--spacing-8);
  list-style: none;
  align-items: center;
}

.nav__links a {
  color: var(--color-text-2);
  font-weight: 500;
  font-size: var(--font-size-base);
  position: relative;
  padding: var(--spacing-2) 0;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-normal);
  border-radius: var(--radius-full);
}

.nav__links a:hover, 
.nav__links a.active {
  color: var(--color-text);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* User Actions in Nav */
.nav__user-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
}

/* Main Content Grid */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-6);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-6);
  align-items: start;
}

@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--spacing-8);
    padding: var(--spacing-8) var(--spacing-6);
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-8));
}

.content-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  min-width: 0; /* Prevents flex blowout */
}

/* Hero Section */
.page-hero {
  width: 100%;
  padding: var(--spacing-12) var(--spacing-6);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: radial-gradient(ellipse at bottom, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMDUiLz4KPC9zdmc+') repeat;
  opacity: 0.5;
  z-index: 0;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: var(--font-size-6xl);
  margin-bottom: var(--spacing-4);
  background: var(--color-bg-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: var(--font-size-xl);
  max-width: var(--max-width-reading);
  margin: 0 auto var(--spacing-8);
  color: var(--color-text-2);
}

/* Section Headers */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-6);
  padding-bottom: var(--spacing-3);
  border-bottom: 1px solid var(--color-border);
}

.section-title h2 {
  font-size: var(--font-size-2xl);
  margin: 0;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-10) var(--spacing-6);
  background: var(--color-bg-2);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
}

@media (min-width: 768px) {
  .footer {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.footer-logo::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--color-bg-2);
  border-radius: 50%;
}

.footer-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-3);
  max-width: 300px;
}

.footer-links h4 {
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: var(--spacing-4);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.footer-links a {
  color: var(--color-text-2);
  font-size: var(--font-size-sm);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: var(--spacing-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-4);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-legal p {
  font-size: var(--font-size-xs);
  color: var(--color-text-3);
  margin: 0;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--spacing-6);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--spacing-12));
  max-width: 800px;
  background: rgba(20, 20, 40, 0.85);
  
  -webkit-
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-5) var(--spacing-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
  z-index: var(--z-toast);
  
  animation: slideUp 0.5s var(--transition-bounce) forwards;
}

.cookie-banner__content {
  flex: 1 1 300px;
}

.cookie-banner__content h4 {
  margin-bottom: var(--spacing-1);
  font-size: var(--font-size-base);
}

.cookie-banner p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-2);
}

.cookie-banner__actions {
  display: flex;
  gap: var(--spacing-3);
}

/**
 * ==========================================================================
 * UTILITIES
 * ==========================================================================
 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }

.text-primary { color: var(--color-text); }
.text-secondary { color: var(--color-text-2); }
.text-muted { color: var(--color-text-3); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--spacing-2); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-6 { margin-top: var(--spacing-6); }
.mt-8 { margin-top: var(--spacing-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-6 { margin-bottom: var(--spacing-6); }
.mb-8 { margin-bottom: var(--spacing-8); }

.pt-4 { padding-top: var(--spacing-4); }
.pb-4 { padding-bottom: var(--spacing-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-full { max-width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm {  }
.shadow-md {  }
.shadow-lg {  }

.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

/**
 * ==========================================================================
 * SKELETON LOADING
 * ==========================================================================
 */
.skeleton {
  background: var(--color-bg-2);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 1rem; width: 100%; margin-bottom: 0.5rem; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 2rem; width: 80%; margin-bottom: 1rem; }
.skeleton-img { height: 200px; width: 100%; border-radius: var(--radius-md); }
.skeleton-avatar { height: 48px; width: 48px; border-radius: var(--radius-full); }
.skeleton-button { height: 40px; width: 120px; border-radius: var(--radius-sm); }

/**
 * ==========================================================================
 * ANIMATIONS & KEYFRAMES
 * ==========================================================================
 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 40px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

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

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulseGlow {
  0% {  }
  70% {  }
  100% {  }
}

@keyframes scoreFill {
  from { width: 0%; }
}

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

/**
 * ==========================================================================
 * RESPONSIVE MEDIA QUERIES
 * ==========================================================================
 */
@media (max-width: 1023px) {
  .nav {
    padding: 0 var(--spacing-4);
  }
  
  .nav__links {
    display: none; /* In JS, toggle a mobile menu class */
  }
  
  .nav__user-actions {
    display: none;
  }
  
  /* Mobile menu button (hamburger) */
  .nav__mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: calc(var(--z-sticky) + 1);
  }
  
  .nav__mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
  }
}

@media (max-width: 767px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
    --spacing-12: 64px;
    --spacing-10: 48px;
    --spacing-8: 32px;
  }
  
  .main-content {
    padding: var(--spacing-4);
  }
  
  .page-hero {
    padding: var(--spacing-8) var(--spacing-4);
  }
  
  .page-hero h1 {
    font-size: var(--font-size-4xl);
  }
  
  .cookie-banner {
    width: calc(100% - var(--spacing-4));
    flex-direction: column;
    text-align: center;
    bottom: var(--spacing-4);
  }
  
  .cookie-banner__actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .cookie-banner__actions button {
    flex: 1;
  }
}
