/**
 * =========================================================================
 * LEANDROMEDA - Modern Sci-Fi Cockpit Stylesheet
 * Project developed for NASA International Space Apps Challenge 2026
 * =========================================================================
 */

/* Base & Layout Mode: Desktop Zero-Scroll vs Mobile Natural Scroll */
    html, body {
      margin: 0;
      padding: 0;
      background: #000;
    }

    @media (min-width: 768px) {
      html, body {
        height: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
      }
      .deck-view {
        position: absolute;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        transform: scale(0.96) translateY(12px);
        transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .deck-view.active {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1) translateY(0);
      }
    }

    @media (max-width: 767px) {
      html, body {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
      }
      #introCutscene {
        display: none !important;
      }
      main {
        overflow-y: visible !important;
        height: auto !important;
        min-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 3.5rem !important;
        padding-top: 1.5rem !important;
        padding-bottom: 3.5rem !important;
      }
      .deck-view {
        position: relative !important;
        inset: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        display: flex !important;
        min-height: auto !important;
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      }
      .deck-view:last-child {
        border-bottom: none;
      }
      footer {
        position: relative !important;
      }
    }

    /* Glassmorphism Styles */
    .glass-card {
      background: rgba(11, 17, 37, 0.75);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
    }
    .glass-card:hover {
      border-color: rgba(56, 189, 248, 0.4);
      box-shadow: 0 12px 40px -8px rgba(0, 242, 254, 0.22);
    }

    .glass-pill {
      background: rgba(15, 23, 42, 0.8);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .text-glow {
      text-shadow: 0 0 25px rgba(56, 189, 248, 0.6), 0 0 50px rgba(121, 40, 202, 0.3);
    }

    .text-gradient {
      background: linear-gradient(135deg, #ffffff 0%, #00f2fe 20%, #a855f7 45%, #f59e0b 70%, #00f2fe 95%);
      background-size: 300% 300%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: none !important;
      animation: leandromedaGradientShift 10s ease-in-out infinite alternate;
    }

    @keyframes leandromedaGradientShift {
      0% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 25px rgba(0, 242, 254, 0.5));
      }
      50% {
        background-position: 100% 50%;
        filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.55));
      }
      100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.5));
      }
    }

    .radar-sweep {
      background: conic-gradient(from 0deg at 50% 50%, rgba(56, 189, 248, 0.3) 0deg, transparent 60deg, transparent 360deg);
      animation: spin 4s linear infinite;
    }

    /* Sound wave animation */
    .sound-bar {
      display: inline-block;
      width: 3px;
      height: 14px;
      margin: 0 1.5px;
      background-color: #38bdf8;
      border-radius: 2px;
      animation: bounceWave 1.2s ease-in-out infinite;
    }
    .sound-bar:nth-child(2) { animation-delay: 0.2s; height: 18px; }
    .sound-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }
    .sound-bar:nth-child(4) { animation-delay: 0.1s; height: 16px; }

    @keyframes bounceWave {
      0%, 100% { transform: scaleY(0.3); }
      50% { transform: scaleY(1); }
    }

    .sound-paused .sound-bar {
      animation: none !important;
      transform: scaleY(0.2) !important;
      opacity: 0.35;
    }

    /* Deck Transition States */
    .deck-view {
      position: absolute;
      inset: 0;
      opacity: 0;
      pointer-events: none;
      transform: scale(0.96) translateY(12px);
      transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .deck-view.active {
      opacity: 1;
      pointer-events: auto;
      transform: scale(1) translateY(0);
    }

    /* Spectral Filter Modes */
    .spectral-infrared {
      filter: sepia(0.6) hue-rotate(320deg) saturate(1.8) contrast(1.1);
    }
    .spectral-xray {
      filter: invert(0.15) hue-rotate(180deg) saturate(2) brightness(1.1);
    }

    /* CRT Scanline effect */
    .crt-overlay {
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 255, 0, 0.02));
      background-size: 100% 3px, 6px 100%;
      pointer-events: none;
    }
  
    /* Team Card & Sincronia Effect */
    .team-member-card {
      position: relative;
      overflow: hidden;
      min-height: 285px;
      transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.3s ease;
    }

    .member-photo-box {
      width: 56px;
      height: 56px;
      transition: width 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
                  height 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
                  margin 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
                  box-shadow 0.45s ease,
                  border-color 0.3s ease;
      position: relative;
      cursor: pointer;
      flex-shrink: 0;
    }
    .member-photo-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top;
      border-radius: 1rem;
      transition: border-radius 0.4s ease;
    }

    /* Expanded photo state on sync (via :has or .is-sync-active) */
    .team-member-card:has(.member-photo-box:hover) .member-photo-box,
    .team-member-card.is-sync-active .member-photo-box {
      width: 120px !important;
      height: 120px !important;
      margin: 0 auto 0.6rem auto !important;
      box-shadow: 0 0 25px rgba(0, 242, 254, 0.5) !important;
    }

    /* Holographic Scanline Overlay */
    .sync-scanline {
      position: absolute;
      inset: 0;
      border-radius: 1rem;
      pointer-events: none;
      opacity: 0;
      background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.45) 50%, rgba(0, 242, 254, 0.9) 52%, transparent 100%);
      background-size: 100% 250%;
      mix-blend-mode: screen;
      transition: opacity 0.3s ease;
      z-index: 5;
    }
    .team-member-card:has(.member-photo-box:hover) .sync-scanline,
    .team-member-card.is-sync-active .sync-scanline {
      opacity: 1 !important;
      animation: memberSyncScan 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    }
    @keyframes memberSyncScan {
      0% { background-position: 0 -120%; }
      100% { background-position: 0 220%; }
    }

    /* Sync HUD badge */
    .sync-hud-badge {
      position: absolute;
      top: 6px;
      right: 6px;
      background: rgba(3, 7, 18, 0.75);
      backdrop-filter: blur(4px);
      border: 1px solid rgba(56, 189, 248, 0.6);
      border-radius: 9999px;
      font-size: 8px;
      font-family: monospace;
      padding: 1.5px 6px;
      color: #38bdf8;
      opacity: 0;
      transform: scale(0.7);
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
      pointer-events: none;
      z-index: 10;
      box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
    }
    .team-member-card:has(.member-photo-box:hover) .sync-hud-badge,
    .team-member-card.is-sync-active .sync-hud-badge {
      opacity: 1 !important;
      transform: scale(1) !important;
    }

    .is-sync-active .member-online-indicator {
      transform: scale(1.1);
    }

    /* Member Description Collapse */
    .member-desc {
      max-height: 120px;
      opacity: 1;
      transform: translateY(0);
      transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
                  opacity 0.32s ease,
                  margin 0.38s ease,
                  transform 0.32s ease;
      overflow: hidden;
    }
    .team-member-card:has(.member-photo-box:hover) .member-desc,
    .team-member-card.is-sync-active .member-desc {
      max-height: 0 !important;
      opacity: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      transform: translateY(-8px) !important;
      pointer-events: none !important;
    }

    /* Member Info Alignment Transition */
    .member-info-block {
      transition: text-align 0.35s ease;
    }
    .team-member-card:has(.member-photo-box:hover) .member-info-block,
    .team-member-card.is-sync-active .member-info-block {
      text-align: center !important;
    }

    /* Absolute LinkedIn Button */
    .member-linkedin-btn {
      position: absolute;
      top: 1rem;
      right: 1rem;
      z-index: 20;
      transition: transform 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
                  background-color 0.25s ease,
                  border-color 0.25s ease,
                  box-shadow 0.25s ease;
    }
    .team-member-card:has(.member-photo-box:hover) .member-linkedin-btn,
    .team-member-card.is-sync-active .member-linkedin-btn {
      box-shadow: 0 0 12px rgba(0, 119, 181, 0.5) !important;
    }

    /* Ativo status indicator */
    .member-active-indicator {
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .team-member-card:has(.member-photo-box:hover) .member-active-indicator,
    .team-member-card.is-sync-active .member-active-indicator {
      opacity: 0 !important;
      transform: scale(0.65) translateX(-6px) !important;
      pointer-events: none !important;
    }

/* ========================================================================= */
/* TRANSMISSION GLITCH & LIVE COCKPIT TUNING STYLES                         */
/* ========================================================================= */

/* Rover background spotlight when tuning into games */
body.rover-spotlight #videoContainer video#bgVideoRover {
  filter: brightness(1.35) contrast(1.15) saturate(1.15);
  transform: scale(1.06);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
body.rover-spotlight .crt-overlay {
  opacity: 0.12 !important;
}

/* Full Central Area Cockpit Mode (Edge-to-edge, Zero Borders, Zero Shadows) */
body.game-cockpit-active main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}

#deck1.in-game-cockpit {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  justify-content: stretch !important;
}

#gameCockpitViewport {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: #000 !important;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

#gameCockpitViewport.tuning-in {
  opacity: 0;
  filter: blur(14px) brightness(1.6);
  transform: none !important;
}

#gameCockpitViewport.tuned-in {
  opacity: 1;
  filter: blur(0px) brightness(1);
  transform: none !important;
}

#gameCockpitFrame {
  width: 100% !important;
  height: calc(100% - 32px) !important;
  flex: 1 1 auto !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

@media (max-width: 767px) {
  body.game-cockpit-active {
    height: 100vh !important;
    overflow: hidden !important;
  }
  body.game-cockpit-active main {
    padding: 0 !important;
    gap: 0 !important;
    height: calc(100vh - 86px) !important;
  }
}

/* Transmission Glitch Overlay */
#transmissionGlitchOverlay {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* NASA Scientific Sources Interactive Cards */
.nasa-source-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease,
              background-color 0.28s ease;
}
.nasa-source-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
}
.nasa-source-card.active-source {
  border-color: rgba(168, 85, 247, 0.95) !important;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.45) !important;
  background: rgba(168, 85, 247, 0.15) !important;
}

/* Discrete Leandro Developer Easter Egg Icon & Note */
.leandro-dev-trigger {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Shown ONLY after photo expansion on the card */
.team-member-card:has(.member-photo-box:hover) .leandro-dev-trigger,
.team-member-card.is-sync-active .leandro-dev-trigger {
  display: inline-flex !important;
  opacity: 0.9;
  pointer-events: auto;
}

.team-member-card:has(.member-photo-box:hover) .leandro-dev-trigger:hover,
.team-member-card.is-sync-active .leandro-dev-trigger:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}

/* Fade-in author text below name */
.leandro-author-note {
  opacity: 0;
  pointer-events: none;
  color: #ffffff !important;
  transform: translate(-50%, -4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.team-member-card:has(.leandro-dev-trigger:hover) .leandro-author-note,
.leandro-dev-trigger:hover ~ .leandro-author-note,
.leandro-author-note.is-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate(-50%, 0) !important;
}
