/*
========================================
  BASE.CSS - Premium Vintage Arcade Showroom
  A refined, cinematic foundation with nostalgic neon accents
========================================
*/

/*
========================================
  CSS VARIABLES
========================================
*/
:root {
  /* Color Palette - Premium & Nostalgic */
  --color-bg-primary: #1a1a1c;
  --color-bg-secondary: #252528;
  --color-bg-elevated: #2d2d31;
  --color-bg-overlay: rgba(26, 26, 28, 0.95);
  
  --color-text-primary: #e8e8ea;
  --color-text-secondary: #b8b8bc;
  --color-text-muted: #88888c;
  --color-text-inverse: #1a1a1c;
  
  --color-primary: #ff2a6d;
  --color-primary-hover: #ff4582;
  --color-primary-active: #e61f5c;
  
  --color-accent-neon-blue: #00d9ff;
  --color-accent-neon-pink: #ff2a6d;
  --color-accent-neon-purple: #b537ff;
  --color-accent-chrome: #c8c8cc;
  
  --color-success: #00ff88;
  --color-warning: #ffaa00;
  --color-danger: #ff3366;
  
  /* Neutral Grays */
  --color-gray-100: #f5f5f7;
  --color-gray-200: #e8e8ea;
  --color-gray-300: #d1d1d6;
  --color-gray-400: #b8b8bc;
  --color-gray-500: #88888c;
  --color-gray-600: #5e5e62;
  --color-gray-700: #3a3a3e;
  --color-gray-800: #252528;
  --color-gray-900: #1a1a1c;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-display: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-editorial: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Roboto Mono', 'Courier New', 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 */
  --font-size-7xl: 4.5rem;      /* 72px */
  
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Spacing Scale */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  
  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-base: 0.5rem;  /* 8px */
  --radius-md: 0.75rem;   /* 12px */
  --radius-lg: 1rem;      /* 16px */
  --radius-xl: 1.5rem;    /* 24px */
  --radius-2xl: 2rem;     /* 32px */
  --radius-full: 9999px;
  
  /* Shadows - Cinematic & Layered */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-base: 0 2px 8px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px 0 rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px 0 rgba(0, 0, 0, 0.6);
  --shadow-2xl: 0 24px 64px 0 rgba(0, 0, 0, 0.7);
  --shadow-neon-pink: 0 0 20px rgba(255, 42, 109, 0.4), 0 0 40px rgba(255, 42, 109, 0.2);
  --shadow-neon-blue: 0 0 20px rgba(0, 217, 255, 0.4), 0 0 40px rgba(0, 217, 255, 0.2);
  --shadow-chrome: 0 2px 12px rgba(200, 200, 204, 0.15);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 400ms ease-in-out;
  --transition-cinematic: 600ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-popover: 1500;
  --z-tooltip: 1600;
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  --container-max: 1920px;
}

/*
========================================
  RESET / NORMALIZE
========================================
*/

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

/* Document */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

/* Remove default margins */
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
ul, ol, dl, dd {
  margin: 0;
}

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

/* Responsive images and media */
img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements inherit font */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove textarea resize */
textarea {
  resize: vertical;
}

/* Table styles */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/*
========================================
  BASE STYLES
========================================
*/

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

/* Typography - Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

h4 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 768px) {
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  h4 { font-size: var(--font-size-xl); }
  h5 { font-size: var(--font-size-lg); }
  h6 { font-size: var(--font-size-base); }
}

/* Paragraphs */
p {
  margin-bottom: var(--space-4);
  max-width: 70ch;
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

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

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
  position: relative;
}

a:hover {
  color: var(--color-primary-hover);
}

a:active {
  color: var(--color-primary-active);
}

/* Strong & Emphasis */
strong, b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

em, i {
  font-style: italic;
}

/* Small text */
small {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Code */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--color-bg-secondary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-accent-neon-blue);
}

pre {
  background-color: var(--color-bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-base);
  overflow-x: auto;
  line-height: var(--line-height-relaxed);
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--color-gray-700);
  margin: var(--space-8) 0;
}

/*
========================================
  UTILITIES
========================================
*/

/* Container */
.container {
  width: 100%;
  max-width: var(--container-2xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-max { max-width: var(--container-max); }

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }

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

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* Text Utilities */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Screen Reader Only */
.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;
}

/* Visually Hidden but Focusable */
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/*
========================================
  COMPONENTS
========================================
*/

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-neon-purple) 100%);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-neon-pink);
}

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

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

/* Secondary Button */
.btn-secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-accent-chrome);
}

.btn-secondary:hover {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-chrome);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

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

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
}

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

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-lg);
}

/* Input Fields */
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-base);
  outline: none;
  transition: all var(--transition-base);
}

.input:hover,
.textarea:hover,
.select:hover {
  background-color: var(--color-bg-elevated);
}

.input:focus,
.textarea:focus,
.select:focus {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 42, 109, 0.1);
}

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

.input:disabled,
.textarea:disabled,
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--color-bg-secondary);
}

/* Card Component */
.card {
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-cinematic);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-elevated {
  background-color: var(--color-bg-elevated);
  box-shadow: var(--shadow-lg);
}

.card-neon {
  border: 1px solid rgba(255, 42, 109, 0.3);
  box-shadow: var(--shadow-neon-pink);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-gray-700);
}

.card-body {
  margin-bottom: var(--space-4);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-gray-700);
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-elevated);
  color: var(--color-text-secondary);
}

.badge-primary {
  background-color: var(--color-primary);
  color: var(--color-text-primary);
}

.badge-neon {
  background-color: transparent;
  border: 1px solid var(--color-accent-neon-blue);
  color: var(--color-accent-neon-blue);
  box-shadow: var(--shadow-neon-blue);
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--color-gray-700);
  margin: var(--space-6) 0;
  border: none;
}

.divider-neon {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  box-shadow: var(--shadow-neon-pink);
}

/*
========================================
  ACCESSIBILITY
========================================
*/

/* Focus Visible Outline */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove default focus outline */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-primary);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: var(--radius-base);
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-to-main:focus {
  transform: translateY(0);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .card:hover,
  .btn:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn,
  .input,
  .card {
    border-width: 2px;
    border-color: currentColor;
  }
}

/* Dark mode enhancements (already dark by default) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/*
========================================
  EDITORIAL & PREMIUM TOUCHES
========================================
*/

/* Editorial Heading */
.heading-editorial {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: var(--font-weight-normal);
  letter-spacing: -0.01em;
}

/* Chrome Accent */
.chrome-accent {
  background: linear-gradient(135deg, #e8e8ea 0%, #c8c8cc 50%, #e8e8ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Neon Glow Text */
.neon-glow {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(255, 42, 109, 0.6),
               0 0 20px rgba(255, 42, 109, 0.4),
               0 0 30px rgba(255, 42, 109, 0.2);
}

/* Premium Separator */
.separator-premium {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-8) 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.separator-premium::before,
.separator-premium::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-gray-700);
}

.separator-premium::before {
  margin-right: var(--space-4);
}

.separator-premium::after {
  margin-left: var(--space-4);
}

/* Aspect Ratio Containers */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-cinematic { aspect-ratio: 21 / 9; }

/* Object Fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-center { object-position: center; }

/*
========================================
  END OF BASE.CSS
========================================
*/