/**
 * LCARS UI Framework - Modern Starfleet Standard
 * Design for Clarity, Immersion, and Animation
 */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Official Starfleet TNG Colors */
  --lcars-orange: #FF9E00;
  --lcars-orange-tan: #FFCC99;
  --lcars-orange-dark: #CC7A00;

  --lcars-purple: #CC99CC;
  --lcars-purple-light: #DFB2DF;
  --lcars-purple-dark: #A67AA6;

  --lcars-blue: #99CCFF;
  --lcars-blue-light: #B2D8FF;
  --lcars-blue-dark: #5C80A6;

  --lcars-tan: #FFCC99;
  --lcars-pink: #FF99CC;
  --lcars-red: #FF3333;
  --lcars-yellow: #FFFF66;
  --lcars-white: #FFFFFF;
  --lcars-black: #000000;

  /* Backgrounds */
  --lcars-bg: #020408;
  --lcars-panel-bg: rgba(2, 4, 8, 0.4);
  --lcars-card-bg: rgba(10, 10, 20, 0.3);

  /* Layout Constants */
  --lcars-br-outer: 40px;
  --lcars-br-inner: 20px;
  --lcars-bar-thick: 45px;
  --lcars-bar-thin: 25px;
  --lcars-gap: 12px;

  /* Typography */
  --lcars-font: 'Rajdhani', sans-serif;
  --lcars-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   ANIMATED STARFIELD (FIXED)
   ============================================ */
.starfield-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at bottom, #0d121c 0%, #000 100%);
  overflow: hidden;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  background: transparent;
  animation: animStar 60s linear infinite;
}

@keyframes animStar {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-2000px);
  }
}

/* ============================================
   LIVE CONSOLE ANIMATIONS
   ============================================ */
.pulse-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  background: var(--lcars-yellow);
  animation: pulseNode 2s infinite ease-in-out;
  box-shadow: 0 0 10px var(--lcars-yellow);
}

@keyframes pulseNode {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.data-packet {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--lcars-white);
  opacity: 0.5;
  filter: blur(1px);
  animation: movePacket 4s linear infinite;
}

@keyframes movePacket {
  0% {
    left: 0;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Scanlines */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 1000;
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
}

/* ============================================
   BASE & LAYOUT
   ============================================ */
body {
  background-color: transparent;
  color: var(--lcars-white);
  font-family: var(--lcars-font);
  margin: 0;
  padding: 20px;
  overflow: hidden;
  height: 100vh;
  box-sizing: border-box;
}

.lcars-layout {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: var(--lcars-gap);
  height: calc(100vh - 40px);
  width: 100%;
  box-sizing: border-box;
}

.lcars-sidebar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 10px;
  border-radius: 20px 0 0 20px;
  border-right: 1px solid rgba(153, 204, 255, 0.15);
  grid-column: 1;
  grid-row: 1;
}

.lcars-sidebar::after {
  content: "";
  position: absolute;
  top: -100px;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(153, 204, 255, 0.2), transparent);
  animation: scanLine 8s linear infinite;
  pointer-events: none;
}

@keyframes scanLine {
  0% {
    top: -100px;
  }

  100% {
    top: 100%;
  }
}

.lcars-main-content {
  border-radius: var(--lcars-br-inner) 0 0 0;
  padding: 25px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  position: relative;
  overflow-y: auto;
  border: 1px solid rgba(153, 204, 255, 0.12);
  grid-row: 1;
}

.lcars-rightshelf {
  grid-column: 3;
  grid-row: 1;
}

/* ============================================
   PILLS & BUTTONS
   ============================================ */
.lcars-pill {
  height: 32px;
  border-radius: 16px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--lcars-black);
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 5px;
  white-space: nowrap;
}

.lcars-pill:hover {
  filter: brightness(1.2);
  padding-right: 25px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.lcars-pill.active {
  background: var(--lcars-white) !important;
  color: var(--lcars-black);
  padding-right: 30px;
}

.pill-orange {
  background: var(--lcars-orange);
}

.pill-purple {
  background: var(--lcars-purple);
}

.pill-blue {
  background: var(--lcars-blue);
}

.pill-tan {
  background: var(--lcars-tan);
}

/* ============================================
   COMPONENTS
   ============================================ */
.lcars-data-card {
  background: rgba(20, 22, 32, 0.18);
  border-left: 6px solid var(--lcars-blue);
  padding: 18px;
  margin-bottom: 15px;
  border-radius: 0 12px 12px 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.lcars-data-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.05),
      transparent);
  transform: skewX(-25deg);
  transition: none;
  pointer-events: none;
}

.lcars-data-card:hover::before,
.lcars-data-card.active-transit::before {
  animation: sweep 1.5s ease-in-out infinite;
}

@keyframes sweep {
  0% {
    left: -150%;
  }

  100% {
    left: 150%;
  }
}

.lcars-data-card:hover {
  background: rgba(60, 65, 90, 0.28);
  transform: translateX(5px) scale(1.01);
  box-shadow: 0 0 20px rgba(153, 204, 255, 0.1);
}

.card-title {
  color: var(--lcars-blue-light);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.lcars-stat-box {
  background: rgba(255, 158, 0, 0.04);
  border-top: 8px solid var(--lcars-orange);
  padding: 15px;
  border-radius: 4px;
}

.lcars-stat-val {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 5px;
}

/* Pipeline / Kanban Columns */
.pipeline-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 500px;
}

.pipeline-col {
  min-width: 220px;
  background: rgba(20, 20, 20, 0.5);
  border-radius: 10px;
  padding: 10px;
}

.col-header {
  background: var(--lcars-blue-dark);
  color: #000;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* Modals */
.lcars-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lcars-modal {
  background: var(--lcars-black);
  border: 4px solid var(--lcars-blue);
  border-radius: var(--lcars-br-outer);
  padding: 30px;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(153, 204, 255, 0.3);
}

/* ============================================
   UTILITIES
   ============================================ */
.stardate-box {
  position: absolute;
  top: 15px;
  right: 25px;
  color: var(--lcars-tan);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.glow-orange {
  text-shadow: 0 0 12px var(--lcars-orange);
}

.glow-blue {
  text-shadow: 0 0 12px var(--lcars-blue);
}

.lcars-input {
  background: #111;
  border: 1px solid var(--lcars-purple);
  color: var(--lcars-orange);
  padding: 12px 15px;
  width: 100%;
  margin-bottom: 12px;
  font-family: var(--lcars-font);
  font-size: 1rem;
}

.lcars-btn-pill {
  background: var(--lcars-orange);
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--lcars-font);
}

.lcars-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: var(--lcars-purple);
  font-weight: 700;
  letter-spacing: 3px;
  animation: blink 1s infinite alternate;
}

@keyframes cardPulse {
  0% {
    box-shadow: 0 0 5px #00c878, 0 0 10px #00c878;
    border-color: #00c878;
  }

  100% {
    box-shadow: 0 0 20px #00c878, 0 0 40px #00c878;
    border-color: #a0ffcc;
  }
}

@keyframes cardPulseRed {
  0% {
    box-shadow: 0 0 5px var(--lcars-red), 0 0 10px var(--lcars-red);
    border-color: var(--lcars-red);
  }

  100% {
    box-shadow: 0 0 20px var(--lcars-red), 0 0 40px var(--lcars-red);
    border-color: #ff6666;
  }
}

.card-intervention-red-glow {
  animation: cardPulseRed 1.2s infinite alternate !important;
  border: 2px solid var(--lcars-red) !important;
  z-index: 10;
}

.card-active-glow {
  animation: cardPulse 1.5s infinite alternate !important;
  border: 2px solid #00c878 !important;
  z-index: 10;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 5px rgba(0, 200, 120, 0.2);
    border-color: #00c878;
  }

  50% {
    box-shadow: 0 0 20px rgba(0, 200, 120, 0.6);
    border-color: #a0ffcc;
  }

  100% {
    box-shadow: 0 0 5px rgba(0, 200, 120, 0.2);
    border-color: #00c878;
  }
}

.system-pulse .lcars-main-content {
  border-color: rgba(153, 204, 255, 0.3) !important;
  box-shadow: inset 0 0 100px rgba(0, 122, 255, 0.05) !important;
}

/* ============================================
   FUTURISTIC LCARS SCROLLBARS
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(153, 204, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--lcars-blue-dark);
  border: 2px solid var(--lcars-black);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(153, 204, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--lcars-blue);
  box-shadow: 0 0 10px var(--lcars-blue);
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--lcars-blue-dark) rgba(0, 0, 0, 0.3);
}

.lcars-main-content::-webkit-scrollbar-thumb {
  background: var(--lcars-purple-dark);
}

.lcars-main-content::-webkit-scrollbar-thumb:hover {
  background: var(--lcars-purple);
}

.pipeline-container::-webkit-scrollbar-thumb {
  background: var(--lcars-orange-dark);
}

.pipeline-container::-webkit-scrollbar-thumb:hover {
  background: var(--lcars-orange);
}