* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

/* Zone Layout */
body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

body.layout-split {
  grid-template-columns: 75% 25%;
}

.zone {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
  overflow: hidden;
}

.sidebar-zone {
  display: none;
  border-left: 2px solid #333;
}

body.layout-split .sidebar-zone {
  display: block;
}

/* Media Items */
.media-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  background-color: #000;
}

/* Transitions */
.transition-fade {
  transition: opacity 1s ease-in-out;
}
.transition-fade.active {
  opacity: 1;
}
.transition-fade.fade-out {
  opacity: 0;
}

.transition-slide-left {
  transform: translateX(100%);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.transition-slide-left.active {
  opacity: 1;
  transform: translateX(0);
}
.transition-slide-left.fade-out {
  transform: translateX(-100%);
  opacity: 0;
}

.transition-slide-right {
  transform: translateX(-100%);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.transition-slide-right.active {
  opacity: 1;
  transform: translateX(0);
}
.transition-slide-right.fade-out {
  transform: translateX(100%);
  opacity: 0;
}

.transition-slide-up {
  transform: translateY(100%);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.transition-slide-up.active {
  opacity: 1;
  transform: translateY(0);
}
.transition-slide-up.fade-out {
  transform: translateY(-100%);
  opacity: 0;
}

.transition-slide-down {
  transform: translateY(-100%);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.transition-slide-down.active {
  opacity: 1;
  transform: translateY(0);
}
.transition-slide-down.fade-out {
  transform: translateY(100%);
  opacity: 0;
}

.transition-zoom-in {
  transform: scale(0.5);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}
.transition-zoom-in.active {
  opacity: 1;
  transform: scale(1);
}
.transition-zoom-in.fade-out {
  transform: scale(1.5);
  opacity: 0;
}

.transition-none {
  /* No transition defined */
}
.transition-none.active {
  opacity: 1;
}
.transition-none.fade-out {
  opacity: 0;
}

/* Fallback for elements without transition classes */
.media-item:not([class*="transition-"]) {
  transition: opacity 1s ease-in-out;
}
.media-item:not([class*="transition-"]).active {
  opacity: 1;
}
.media-item:not([class*="transition-"]).fade-out {
  opacity: 0;
}


/* YouTube Player */
.youtube-player {
  width: 100%;
  height: 100%;
}

.youtube-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Web Page / iFrame Container */
.webpage-container {
  width: 100%;
  height: 100%;
  background: #fff;
}

.webpage-container iframe {
  width: 100%;
  height: 100%;
}

/* PDF Viewer */
.pdf-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
}

.pdf-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pdf-canvas {
  max-width: 95%;
  max-height: 90%;
  object-fit: contain;
}

.pdf-page-indicator {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  margin-top: 16px;
  backdrop-filter: blur(10px);
}

/* Widget Container */
.widget-container {
  width: 100%;
  height: 100%;
}

.widget-container iframe {
  width: 100%;
  height: 100%;
}

/* RSS Feed */
.rss-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.rss-feed {
  width: 85%;
  max-width: 1200px;
  padding: 60px;
}

.rss-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.rss-icon {
  font-size: 3rem;
}

.rss-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.rss-item {
  color: #fff;
}

.rss-item-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  background: linear-gradient(90deg, #f093fb, #f5576c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rss-item-desc {
  font-size: 1.4rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  max-height: 200px;
  overflow: hidden;
}

.rss-item-date {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes rssSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* QR Code */
.qrcode-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.qr-canvas {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  background: #fff;
  padding: 20px;
}

.qr-label {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Countdown Timer */
.countdown-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c0c0c, #1a1a2e, #16213e);
}

.countdown-wrapper {
  text-align: center;
}

.countdown-title {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 60px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.countdown-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px 40px;
  backdrop-filter: blur(10px);
}

.countdown-num {
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(180deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.countdown-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 12px;
}

.countdown-sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 4rem;
  font-weight: 300;
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.countdown-finished {
  font-size: 4rem;
  color: #fff;
  animation: countdownCelebrate 0.6s ease infinite alternate;
}

@keyframes countdownCelebrate {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

/* Audio Visual */
.audio-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #141e30, #243b55);
}

.audio-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.audio-icon {
  font-size: 5rem;
  animation: audioFloat 2s ease-in-out infinite;
}

@keyframes audioFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.audio-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  max-width: 600px;
}

.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
}

.audio-bar {
  width: 8px;
  background: linear-gradient(to top, #667eea, #764ba2);
  border-radius: 4px;
  animation: audioBarAnim 0.8s ease-in-out infinite alternate;
}

.audio-bar:nth-child(1) { height: 30%; animation-delay: 0s; }
.audio-bar:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.audio-bar:nth-child(3) { height: 90%; animation-delay: 0.2s; }
.audio-bar:nth-child(4) { height: 50%; animation-delay: 0.3s; }
.audio-bar:nth-child(5) { height: 80%; animation-delay: 0.15s; }
.audio-bar:nth-child(6) { height: 40%; animation-delay: 0.25s; }
.audio-bar:nth-child(7) { height: 70%; animation-delay: 0.05s; }
.audio-bar:nth-child(8) { height: 55%; animation-delay: 0.35s; }

@keyframes audioBarAnim {
  from { height: 20%; }
  to { height: 100%; }
}

/* Weather Dashboard */
.weather-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.wd-wrapper {
  width: 85%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.wd-loading {
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  text-align: center;
}

.wd-current {
  text-align: center;
}

.wd-location {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.wd-temp-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.wd-icon-big {
  font-size: 6rem;
}

.wd-temp-value {
  font-size: 7rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wd-details-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4rem;
}

.wd-forecast {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.wd-day {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px 32px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  min-width: 120px;
}

.wd-day-name {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.wd-day-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.wd-day-temp {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Loading Message */
.loading-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-message p {
  font-size: 1.5rem;
  font-weight: 300;
}

/* Marquee */
.marquee-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: none;
  align-items: center;
  overflow: hidden;
}

.marquee-container.active {
  display: flex;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 15s linear infinite;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  white-space: nowrap;
}

@keyframes marquee {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100%, 0);
  }
}

/* Top Right Widgets */
.top-right-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 15px;
}

.widget-box {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 12px;
  color: #fff;
  font-family: "Segoe UI", sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.widget-box.active {
  display: flex;
}

#weather-widget span {
  font-size: 1.4rem;
}

/* Emergency Overlay */
.emergency-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: red;
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.emergency-overlay.active {
  display: flex;
}

.emergency-message {
  color: #fff;
  font-size: 6rem;
  font-weight: 900;
  padding: 50px;
  animation: blink 1s infinite;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Connection Status */
.connection-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  font-size: 0.9rem;
  color: #fff;
  transition: opacity 0.3s, transform 0.3s;
}

.connection-status.online {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.connection-status.online:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff4444;
  animation: pulse 2s infinite;
}

.connection-status.online .status-dot {
  background-color: #44ff44;
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 768px) {
  body.layout-split {
    grid-template-columns: 1fr;
    grid-template-rows: 70% 30%;
  }

  .sidebar-zone {
    border-left: none;
    border-top: 2px solid #333;
  }

  .widget-box {
    font-size: 1.2rem;
    padding: 8px 16px;
  }

  .emergency-message {
    font-size: 3rem;
  }

  .countdown-num {
    font-size: 3rem;
  }

  .countdown-block {
    padding: 20px 24px;
  }

  .rss-item-title {
    font-size: 1.8rem;
  }

  .wd-temp-value {
    font-size: 4rem;
  }

  .wd-icon-big {
    font-size: 4rem;
  }
}
