/* Minimal Fullscreen Demo Styles */

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

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #000;
  overflow-x: hidden;
}

/* Fullscreen poster sections */
.poster-section {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  background: #000;
}

/* Both .poster-container and .liveposter-container for compatibility */
.poster-container,
.liveposter-container {
  --aspect-ratio: 9/16; /* Default aspect ratio */
  position: relative;
}

/* Default: Contain mode - preserve aspect ratio with black bars */
.poster-container.contain,
.liveposter-container.contain {
  aspect-ratio: var(--aspect-ratio);
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
}

/* Portrait mode: width is constrained */
@media (max-aspect-ratio: 9/16) {
  .poster-container.contain,
  .liveposter-container.contain {
    width: 100vw;
    height: auto;
  }
}

/* Landscape mode: height is constrained */
@media (min-aspect-ratio: 9/16) {
  .poster-container.contain,
  .liveposter-container.contain {
    width: auto;
    height: 100vh;
  }
}

/* Fill mode - stretch to fill container */
.poster-container.fill,
.liveposter-container.fill {
  width: 100vw;
  height: 100vh;
}

/* ImageAnimator creates its own elements inside - ensure they fill the container */
.poster-container > *,
.liveposter-container > * {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* Optional: Navigation hint (fades out after a few seconds) */
.nav-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.85rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Show nav hint when UI is visible */
body.show-ui .nav-hint:not(.hidden) {
  opacity: 1;
}

.nav-hint.hidden {
  opacity: 0;
}

.nav-hint kbd {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  margin: 0 2px;
}

/* Poster Menu Styles */
.poster-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
  overflow-y: auto;
  padding: 80px 20px 40px;
}

.poster-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

.poster-menu-container {
  max-width: 1600px;
  margin: 0 auto;
}

.poster-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  color: #fff;
}

.poster-menu-title {
  font-size: 2rem;
  font-weight: 600;
}

.poster-menu-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-menu-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.poster-menu-close svg {
  width: 32px;
  height: 32px;
}

.poster-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  width: 100%;
}

.poster-menu-item {
  position: relative;
  aspect-ratio: 9/16;
  background: #111;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poster-menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.poster-menu-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* AR badge indicator */
.poster-menu-item-ar-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

.poster-menu-item-ar-badge svg {
  width: 14px;
  height: 14px;
}

.poster-menu-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 15px;
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.poster-menu-item:hover .poster-menu-item-overlay {
  transform: translateY(0);
}

.poster-menu-item-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.poster-menu-item-count {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Menu toggle button */
.menu-toggle-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

/* Show menu button when UI is visible or menu is open */
body.show-ui .menu-toggle-button,
body.menu-open .menu-toggle-button {
  opacity: 1;
  pointer-events: auto;
}

.menu-toggle-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.menu-toggle-button svg {
  width: 28px;
  height: 28px;
}

/* Fullscreen toggle button */
.fullscreen-toggle-button {
  position: fixed;
  top: 20px;
  left: 80px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

/* Show fullscreen button when UI is visible or menu is open */
body.show-ui .fullscreen-toggle-button,
body.menu-open .fullscreen-toggle-button {
  opacity: 1;
  pointer-events: auto;
}

.fullscreen-toggle-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.fullscreen-toggle-button svg {
  width: 28px;
  height: 28px;
}

/* Hide fullscreen button when not supported */
.fullscreen-toggle-button.hidden {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .poster-menu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .poster-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .poster-menu-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .poster-menu-overlay {
    padding: 60px 15px 30px;
  }

  .poster-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }

  .poster-menu-title {
    font-size: 1.3rem;
  }

  .menu-toggle-button {
    top: 15px;
    left: 15px;
    padding: 10px;
  }

  .menu-toggle-button svg {
    width: 24px;
    height: 24px;
  }

  .fullscreen-toggle-button {
    top: 15px;
    left: 65px;
    padding: 10px;
  }

  .fullscreen-toggle-button svg {
    width: 24px;
    height: 24px;
  }
}
