/* ==========================================================================
   WEST RUNNERS MOTORSPORT — DESIGN SYSTEM & CINEMATIC STYLES
   Timișoara, Timiș, Romania · Est. 2015 · Chapter II 2027
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@600;700;800;900&display=swap');

:root {
  --bg-primary: #0a0b0e;
  --bg-secondary: #12141c;
  --bg-surface: #171a22;
  --bg-surface-elevated: #1e222d;
  --bg-surface-glass: rgba(23, 26, 34, 0.72);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-metallic: #2a2e40;
  --border-accent: rgba(255, 42, 63, 0.35);
  --border-accent-strong: #ff2a3f;
  
  --accent-red: #ff2a3f;
  --accent-crimson: #8b0014;
  --accent-deep-red: #4a080f;
  --accent-glow: rgba(255, 42, 63, 0.28);
  --accent-glow-strong: rgba(255, 42, 63, 0.55);
  
  --text-primary: #ffffff;
  --text-muted: #8c919d;
  --text-dim: #545966;
  
  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', monospace;
  
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 42, 63, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(139, 0, 20, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(255, 42, 63, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-metallic);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-red);
}

/* Selection */
::selection {
  background: var(--accent-red);
  color: #ffffff;
}

/* Typography Utilities */
.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.font-mono {
  font-family: var(--font-mono);
}
.font-sans {
  font-family: var(--font-sans);
}

/* Subtle Cinematic Film Grain Overlay */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Scanline Overlay (Subtle NFS Underground / Cinematic Vibe) */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 998;
  opacity: 0.02;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.4)
  );
  background-size: 100% 4px;
}

/* Red Ambient Spotlight Following Cursor (Desktop Only) */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 42, 63, 0.07) 0%, rgba(139, 0, 20, 0.02) 45%, transparent 70%);
  z-index: 990;
  transition: opacity 0.4s ease;
  opacity: 0;
}
body.mouse-active .cursor-glow {
  opacity: 1;
}

/* Glassmorphic Surfaces */
.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
}

.glass-panel-elevated {
  background: rgba(30, 34, 45, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-metallic);
}

/* Chamfered Tech Corners (Polygon Clip-Path) */
.tech-clip-sm {
  clip-path: polygon(
    0 0, 
    calc(100% - 10px) 0, 
    100% 10px, 
    100% 100%, 
    10px 100%, 
    0 calc(100% - 10px)
  );
}

.tech-clip-btn {
  clip-path: polygon(
    0 0, 
    calc(100% - 8px) 0, 
    100% 8px, 
    100% 100%, 
    8px 100%, 
    0 calc(100% - 8px)
  );
}

.tech-clip-card {
  clip-path: polygon(
    0 0, 
    calc(100% - 16px) 0, 
    100% 16px, 
    100% 100%, 
    16px 100%, 
    0 calc(100% - 16px)
  );
}

/* Buttons */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: var(--accent-red);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95rem 1.85rem;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s var(--ease-cinematic);
  box-shadow: 0 4px 20px rgba(255, 42, 63, 0.28);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover {
  background: #ff152c;
  box-shadow: 0 0 30px rgba(255, 42, 63, 0.55), 0 0 10px rgba(255, 42, 63, 0.4);
  transform: translateY(-2px);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: rgba(23, 26, 34, 0.85);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95rem 1.85rem;
  border: 1px solid var(--border-metallic);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.3s var(--ease-cinematic);
}

.btn-secondary:hover {
  border-color: var(--accent-red);
  color: #ffffff;
  background: rgba(255, 42, 63, 0.08);
  box-shadow: 0 0 20px rgba(255, 42, 63, 0.2);
  transform: translateY(-2px);
}

.btn-outline-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent-red);
  transition: all 0.25s ease;
}

.btn-outline-red:hover {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 42, 63, 0.4);
}

/* Glow Badges & Tags */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 42, 63, 0.08);
  border: 1px solid rgba(255, 42, 63, 0.25);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff5264;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* Red Accent Glow Utilities */
.text-accent {
  color: var(--accent-red);
}
.border-accent-left {
  border-left: 3px solid var(--accent-red);
}
.glow-text-red {
  text-shadow: 0 0 20px rgba(255, 42, 63, 0.45);
}
.glow-box-red {
  box-shadow: 0 0 35px rgba(255, 42, 63, 0.18);
}

/* Editorial Typography */
.editorial-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.editorial-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-red);
}

/* Nav Item Hover Line */
.nav-link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.25s ease;
}
.nav-link:hover, .nav-link.active {
  color: #ffffff;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-red);
  transition: width 0.3s var(--ease-cinematic);
  box-shadow: 0 0 8px var(--accent-red);
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Sticky Header Scroll Effect */
header.scrolled {
  background: rgba(10, 11, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 42, 63, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* Category Cards */
.category-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-metallic);
  transition: all 0.4s var(--ease-cinematic);
}

.category-card img {
  transition: transform 0.7s var(--ease-cinematic), filter 0.5s ease;
  filter: brightness(0.75) contrast(1.15) saturate(0.9);
}

.category-card:hover img {
  transform: scale(1.06);
  filter: brightness(0.9) contrast(1.2) saturate(1.1);
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent-red);
  box-shadow: 0 0 12px var(--accent-red);
  transition: width 0.4s var(--ease-cinematic);
}

.category-card:hover {
  border-color: rgba(255, 42, 63, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 42, 63, 0.12);
}

.category-card:hover::after {
  width: 100%;
}

/* Masonry Image Gallery */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1400px) {
  .masonry-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.35s var(--ease-cinematic);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-cinematic), filter 0.4s ease;
  filter: brightness(0.82) contrast(1.1);
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.98) contrast(1.15);
}

.gallery-item .overlay-info {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 14, 0.95) 0%, rgba(10, 11, 14, 0.4) 40%, transparent 80%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s var(--ease-cinematic);
}

.gallery-item:hover .overlay-info {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item:hover {
  border-color: rgba(255, 42, 63, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 42, 63, 0.18);
}

/* Fallback Glass Placeholder (if image is missing) */
.fallback-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, rgba(23, 26, 34, 0.95) 0%, rgba(18, 20, 28, 0.95) 100%);
  border: 1px dashed var(--border-metallic);
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Cinematic Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(6, 7, 10, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 42, 63, 0.15);
  border: 1px solid rgba(255, 42, 63, 0.25);
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

/* Lightbox Controls */
.lightbox-btn {
  position: absolute;
  background: rgba(23, 26, 34, 0.8);
  border: 1px solid var(--border-metallic);
  color: #ffffff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  z-index: 10;
}

.lightbox-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 20px rgba(255, 42, 63, 0.5);
}

.lightbox-close {
  top: 25px;
  right: 25px;
}

.lightbox-prev {
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
}

/* Form Styles */
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(18, 20, 28, 0.85);
  border: 1px solid var(--border-metallic);
  color: #ffffff;
  padding: 0.9rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: all 0.25s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-red);
  background: rgba(23, 26, 34, 0.95);
  box-shadow: 0 0 15px rgba(255, 42, 63, 0.25);
}

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

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Form Tabs */
.form-tab {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1.75rem;
  background: rgba(18, 20, 28, 0.6);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.form-tab.active {
  background: var(--bg-surface);
  color: #ffffff;
  border-color: var(--border-metallic);
  border-top: 2px solid var(--accent-red);
}

/* Scroll Reveal Animations */
.reveal-up {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.9s var(--ease-cinematic);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Sound Wave Animation for Navbar Audio Engine */
.sound-bar {
  display: inline-block;
  width: 3px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: height 0.15s ease, background-color 0.2s ease;
}
.audio-playing .sound-bar {
  background: var(--accent-red);
  animation: sound-bounce 1.2s infinite ease-in-out alternate;
}
.audio-playing .sound-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.audio-playing .sound-bar:nth-child(2) { height: 16px; animation-delay: 0.3s; }
.audio-playing .sound-bar:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.audio-playing .sound-bar:nth-child(4) { height: 18px; animation-delay: 0.4s; }

@keyframes sound-bounce {
  0% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.3); }
  100% { transform: scaleY(0.6); }
}

/* Hero Ken Burns & Cinematic Depth */
.hero-bg-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: brightness(0.55) contrast(1.25) saturate(0.85);
  animation: hero-subtle-zoom 25s ease-in-out infinite alternate;
  transform-origin: center center;
}

@keyframes hero-subtle-zoom {
  0% {
    transform: scale(1.02) translate(0, 0);
  }
  100% {
    transform: scale(1.08) translate(-1%, -1%);
  }
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 11, 14, 0.4) 0%,
    rgba(10, 11, 14, 0.2) 30%,
    rgba(10, 11, 14, 0.7) 70%,
    rgba(10, 11, 14, 1) 100%
  ),
  radial-gradient(
    circle at 50% 50%,
    transparent 20%,
    rgba(10, 11, 14, 0.75) 85%
  );
  z-index: 2;
}

/* Custom Scroll Down Indicator */
.scroll-indicator-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent-red), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-indicator-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #ffffff;
  animation: scroll-drop 1.8s infinite cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes scroll-drop {
  0% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* Mobile Responsive Tweaks */
@media (max-width: 768px) {
  .lightbox-btn {
    width: 40px;
    height: 40px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 15px; right: 15px; }
}
