/**
 * SplitFlapText Component Styles (React Bits Vanilla JS Integration)
 * High-performance 3D departure board split-flap animation with Spatial/Cyber styling.
 */

.split-flap-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--split-flap-text-color, #00f2ff);
  font-family: 'Roboto Mono', 'SFMono-Regular', 'Cascadia Code', monospace;
  font-size: var(--split-flap-font-size, 20px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: pre;
  user-select: none;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}

.split-flap-text__tile {
  position: relative;
  width: 0.8em;
  height: 1.18em;
  overflow: hidden;
  border-radius: var(--split-flap-radius, 4px);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 242, 255, 0.15), transparent 52%),
    linear-gradient(
      180deg,
      #131e36,
      var(--split-flap-tile-color, #070c18)
    );
  box-shadow:
    0 0.03em 0.08em rgba(0, 242, 255, 0.16) inset,
    0 -0.05em 0.1em rgba(0, 0, 0, 0.8) inset,
    0 4px 12px rgba(0, 0, 0, 0.55);
  perspective: 500px;
  transform-style: preserve-3d;
  isolation: isolate;
  flex-shrink: 0;
  margin-right: var(--split-flap-gap, 3px);
  transition:
    width 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    margin-right 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.split-flap-text__tile:last-child {
  margin-right: 0 !important;
}

/* Seamless space between words */
.split-flap-text__tile.tile--space {
  width: 0.32em !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Hidden / collapsing tile state for butter-smooth resizing */
.split-flap-text__tile.tile--hidden {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  transform: scaleX(0);
  pointer-events: none !important;
  border: none !important;
  box-shadow: none !important;
  visibility: hidden;
}

.split-flap-text__tile.tile--space::before,
.split-flap-text__tile.tile--space::after {
  display: none !important;
}

/* Straight mechanical razor-sharp division seam line */
.split-flap-text__tile::before {
  content: '';
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

/* Subtle clean rim outline */
.split-flap-text__tile::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 9;
  border: 1px solid rgba(0, 242, 255, 0.18);
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  pointer-events: none;
}

.split-flap-text__half,
.split-flap-text__flap {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%),
    var(--split-flap-tile-color, #070c18);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.split-flap-text__half--top,
.split-flap-text__flap--front {
  top: 0;
}

.split-flap-text__half--bottom,
.split-flap-text__flap--back {
  bottom: 0;
  background:
    linear-gradient(0deg, rgba(0, 242, 255, 0.04), transparent 45%),
    #050812;
}

.split-flap-text__char {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--split-flap-text-color, #00f2ff);
  text-shadow:
    0 0 6px rgba(0, 242, 255, 0.6),
    0 0 16px rgba(0, 242, 255, 0.25);
  font-family: inherit;
}

.split-flap-text__half--top .split-flap-text__char,
.split-flap-text__flap--front .split-flap-text__char {
  top: 0;
}

.split-flap-text__half--bottom .split-flap-text__char,
.split-flap-text__flap--back .split-flap-text__char {
  bottom: 0;
}

.split-flap-text__flap {
  z-index: 6;
  will-change: transform, filter;
  transform-style: preserve-3d;
}

.split-flap-text__flap--front {
  transform-origin: center bottom;
  animation: split-flap-front var(--split-flap-flip-duration, 0.1s) cubic-bezier(0.23, 1, 0.32, 1) both;
}

.split-flap-text__flap--back {
  transform-origin: center top;
  transform: rotateX(90deg);
  animation: split-flap-back var(--split-flap-flip-duration, 0.1s) cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes split-flap-front {
  0% {
    transform: rotateX(0deg);
    filter: brightness(1.15);
  }
  100% {
    transform: rotateX(-90deg);
    filter: brightness(0.38);
  }
}

@keyframes split-flap-back {
  0%,
  45% {
    transform: rotateX(90deg);
    filter: brightness(0.48);
  }
  100% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .split-flap-text__flap {
    animation: none !important;
  }
}

/* ==========================================================================
   HERO GREETING HUD POD STYLING
   Mathematically strictly equal 4-sided gap around text container:
   - Top gap: 12px
   - Bottom gap: 12px
   - Left gap (to dot): 12px (via flex gap: 12px)
   - Right gap: 12px (via padding-right: 12px)
   - Dot left clearance: 14px (nestled comfortably in pill round cap)
   - Smooth container resizing via CSS width transitions
   ========================================================================== */

.hero-greeting-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 12px 12px 12px 14px;
  background: rgba(6, 12, 28, 0.72);
  border: 1px solid rgba(0, 242, 255, 0.28);
  border-radius: 100px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(0, 242, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin: 0 auto 24px auto;
  position: relative;
  z-index: 10;
  max-width: 98vw;
  box-sizing: border-box;
  will-change: width;
  transition:
    width 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    max-width 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.hero-greeting-container:hover {
  border-color: rgba(0, 242, 255, 0.5);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(0, 242, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.greeting-dot {
  position: static;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f2ff;
  box-shadow: 0 0 10px #00f2ff, 0 0 18px rgba(0, 242, 255, 0.6);
  animation: greetingPulse 2s infinite ease-in-out;
  flex-shrink: 0;
  margin: 0;
  pointer-events: none;
}

@keyframes greetingPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
    box-shadow: 0 0 8px #00f2ff;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    box-shadow: 0 0 14px #00f2ff, 0 0 22px rgba(0, 242, 255, 0.7);
  }
}

#hero-greeting-board,
.hero-split-flap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

/* Responsive adjustments maintaining equal 4-sided text gap */
@media (max-width: 1200px) {
  .split-flap-text {
    font-size: 19px !important;
  }
  .hero-greeting-container {
    gap: 11px;
    padding: 11px 11px 11px 13px;
  }
}

@media (max-width: 900px) {
  .split-flap-text {
    font-size: 16px !important;
  }
  .hero-greeting-container {
    gap: 10px;
    padding: 10px 10px 10px 12px;
    margin-bottom: 18px;
  }
  .greeting-dot {
    width: 7px;
    height: 7px;
  }
}

@media (max-width: 600px) {
  .split-flap-text {
    font-size: 12px !important;
  }
  .hero-greeting-container {
    gap: 8px;
    padding: 8px 8px 8px 10px;
    margin-bottom: 15px;
  }
  .greeting-dot {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 400px) {
  .split-flap-text {
    font-size: 10.5px !important;
  }
  .hero-greeting-container {
    gap: 6px;
    padding: 6px 6px 6px 8px;
  }
  .greeting-dot {
    width: 5px;
    height: 5px;
  }
}
