/* ── CSS Grid Layouts for PechMedia Display/Receiver ── */
#display-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  display: grid;
}

.media-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Base Full Screen */
.layout-full {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* Base Split Layout (columns set via JS) */
.layout-split {
  grid-template-rows: 1fr;
}

/* Separator styling */
.frame-separator {
  background-color: #fff;
  z-index: 10;
}

/* Layers inside each frame */
.layer, .display-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.layer.active, .display-layer.active {
  opacity: 1;
}

/* Scrolling Text Container */
.scrolling-text-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  background: transparent;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
  position: relative;
}

.scrolling-text-content {
  font-size: 3vw;
  font-weight: 700;
  white-space: nowrap;
  position: absolute;
  left: 100%;
  /* Default horizontal scrolling */
  animation-name: scrollTextHorizontal;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Horizontal scroll */
@keyframes scrollTextHorizontal {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100vw - 100%)); }
}

/* Vertical scrolling override for side-by-side layouts */
.layout-split .scrolling-text-container {
  align-items: flex-start;
  justify-content: center;
}

.layout-split .scrolling-text-content {
  left: auto;
  top: 100%;
  font-size: 4vh;
  white-space: normal;
  text-align: center;
  width: 80%;
  animation-name: scrollTextVertical;
}

@keyframes scrollTextVertical {
  0% { transform: translateY(0); }
  100% { transform: translateY(calc(-100vh - 100%)); }
}

/* Ticker Overlay */
.ticker-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  font-weight: 700;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.ticker-content {
  white-space: nowrap;
  position: absolute;
  left: 100%;
  display: inline-block;
  /* Animation is applied dynamically in JavaScript based on text length to maintain constant scroll speed */
}

@keyframes tickerScrollHorizontal {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% - 100vw)); }
}
