/* =============================================
   MUSEUM LAUNCHER — style.css
   ============================================= */

:root {
  --primary-cyan: #00CFFF;
  --secondary-cyan: #6BE8FF;
  --deep-ocean: #111114;
  --ocean-surface: #1C1C20;
  --cool-white: #FFF5EB;

  --card-w: min(58vw, 900px);
  --card-h: clamp(340px, 36vw, 530px);

  /* Side-card offset: positions side card so ~50px overlaps behind center */
  --side-offset: calc(var(--card-w) * 0.94 - 50px);
  --side-scale: 0.88;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--deep-ocean);
  color: var(--cool-white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* =============================================
   BACKGROUND LAYERS
   ============================================= */

/* Per-app colour glow — JS sets the background colour,
   CSS only handles position / transition */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}


#bgGlow0,
#bgGlow1,
#bgGlow2,
#bgGlow3 {
  background: transparent;
  opacity: 0;
}

/* Water particles */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.water-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: float linear infinite;
  opacity: 0;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) scale(1);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  80% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-10vh) translateX(var(--drift)) scale(0.3);
    opacity: 0;
  }
}

/* Film-grain noise - positioned above gradients to break color banding */
.noise {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.10;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* =============================================
   LAYOUT
   ============================================= */
.main {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 0 0px;
  gap: 40px;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  text-align: center;
  padding: 0 24px;
  animation: fadeInDown 0.9s ease-out both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  display: block;
  margin: 0 auto 22px;
  max-height: clamp(110px, 12vw, 190px);
  max-width: min(600px, 88vw);
  width: auto;
  object-fit: contain;
  filter: none;
}

.logo-group {
  margin: 0 auto 40px;
}

.logo-set {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-set.lang-active {
  display: flex;
}

.logo-set .logo {
  margin: 0;
}

.logo-1 {
  width: 90px;
  height: auto;
  max-width: 100%;
  max-height: none;
}

.logo-2 {
  height: 90px;
  max-width: 100%;
  max-height: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid rgba(0, 207, 255, 0.3);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary-cyan);
  margin-bottom: 20px;
  background: rgba(0, 207, 255, 0.06);
  backdrop-filter: blur(10px);
}

.badge svg {
  width: 14px;
  height: 14px;
  fill: var(--secondary-cyan);
}

.title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 0.95;
  letter-spacing: 3px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--cool-white) 0%, rgba(255, 245, 235, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 300;
  color: rgba(255, 245, 235, 0.4);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* =============================================
   CAROUSEL SECTION
   ============================================= */
.carousel-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeInUp 0.9s ease-out 0.2s both;
}

/* ── Viewport ── */
.carousel-viewport {
  position: relative;
  width: 100%;
  height: var(--card-h);
  overflow: hidden;
  /* clips far-left / far-right ghost items */
}

.carousel-track {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
  user-select: none;
}

/* =============================================
   CAROUSEL ITEM (full-bleed card)
   ============================================= */
.carousel-item {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-w) / -2);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition:
    transform 0.68s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.68s ease,
    filter 0.55s ease,
    box-shadow 0.4s ease;
  will-change: transform, opacity, filter;
}

.carousel-item.no-transition {
  transition: none !important;
}

/* ── Position states ── */
.carousel-item[data-pos="center"] {
  transform: translateX(0) scale(1);
  opacity: 1;
  filter: none;
  z-index: 3;

}

.carousel-item[data-pos="left"] {
  transform: translateX(calc(-1 * var(--side-offset))) scale(var(--side-scale));
  opacity: 0.72;
  filter: brightness(0.58);
  z-index: 2;
}

.carousel-item[data-pos="right"] {
  transform: translateX(var(--side-offset)) scale(var(--side-scale));
  opacity: 0.72;
  filter: brightness(0.58);
  z-index: 2;
}

.carousel-item[data-pos="far-left"] {
  transform: translateX(calc(var(--side-offset) * -2.6)) scale(0.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.carousel-item[data-pos="far-right"] {
  transform: translateX(calc(var(--side-offset) * 2.6)) scale(0.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* Hover: side cards lighten as hint */
.carousel-item[data-pos="left"]:hover,
.carousel-item[data-pos="right"]:hover {
  opacity: 0.88;
  filter: brightness(0.78);
}

/* ── Placeholder gradient when no real image is set ── */
.app-0 {
  background-color: #0b1228;
  background-image:
    linear-gradient(145deg, #0b1228 0%, #1a2644 45%, #041c26 100%);
}

.app-1 {
  background-color: #06141a;
  background-image:
    linear-gradient(145deg, #06141a 0%, #0a2630 45%, #00364a 100%);
}

.app-2 {
  background-color: #0c0820;
  background-image:
    linear-gradient(145deg, #0c0820 0%, #1a1040 45%, #240e3c 100%);
}

/* When a real screenshot is provided, the inline style overrides above */

/* ── Large decorative background icon (placeholder only) ── */
.item-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8%;
  pointer-events: none;
  z-index: 1;
}

/* Hide art when a real background-image is present on the item */
.carousel-item[style*="background-image"] .item-art {
  display: none;
}

.item-art svg {
  width: clamp(160px, 30%, 260px);
  height: auto;
  opacity: 0.12;
}

.app-0 .item-art svg {
  color: #27D8FF;
}

.app-1 .item-art svg {
  color: #57E2FF;
}

.app-2 .item-art svg {
  color: #8B6FCF;
}

.app-3 {
  background-color: #00141c;
  background-image:
    linear-gradient(145deg, #00141c 0%, #002b3a 45%, #00445c 100%);
}

.app-3 .item-art svg {
  color: #27D8FF;
}

/* ── Bottom gradient overlay for text readability ── */
.item-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom,
      transparent 28%,
      rgba(0, 0, 0, 0.25) 52%,
      rgba(0, 0, 0, 0.78) 76%,
      rgba(0, 0, 0, 0.92) 100%);
}

/* ── Text content ── */
.item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 28px 26px;
  z-index: 3;
}

.item-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: 2px;
  line-height: 1.05;
  color: var(--cool-white);
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.item-desc {
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 300;
  color: rgba(255, 245, 235, 0.62);
  line-height: 1.6;
  max-width: 78%;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  transition: opacity 0.3s ease;
}

/* Hide description on side cards */
.carousel-item:not([data-pos="center"]) .item-desc {
  opacity: 0;
  pointer-events: none;
}

/* ── Play hint (fades in on center hover) ── */
.item-play-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 14px));
  z-index: 4;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  border: 2px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.item-play-hint svg {
  width: 26px;
  height: 26px;
  color: #fff;
  margin-left: 3px;
}

.carousel-item[data-pos="center"]:hover .item-play-hint {
  opacity: 1;
  transform: translate(-50%, calc(-50% + 0px));
}


/* =============================================
   CAROUSEL ARROWS
   (positioned just outside the center card edges)
   ============================================= */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px);
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.carousel-arrow:hover {
  background: #f0f0f0;
  border-color: #ffffff;
  transform: translateY(-50%) scale(1.12);
}

.arrow-left {
  left: calc(50% - var(--card-w) / 2 - 60px);
}

.arrow-right {
  left: calc(50% + var(--card-w) / 2 + 8px);
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

/* =============================================
   CAROUSEL DOTS
   ============================================= */
.carousel-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 245, 235, 0.2);
  cursor: pointer;
  transition: all 0.35s ease;
}

.carousel-dot.active {
  background: var(--primary-cyan);
  width: 28px;
}

/* =============================================
   LANGUAGE TOGGLE
   ============================================= */
.lang-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.lang-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: rgba(255, 245, 235, 0.38);
}

.lang-btn.active {
  background: var(--primary-cyan);
  color: var(--cool-white);
}

.lang-btn:not(.active):hover {
  color: var(--cool-white);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  animation: fadeInUp 0.8s ease-out 0.5s both;
  padding: 0 24px;
}

.footer .museum-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  color: rgba(255, 245, 235, 0.28);
  margin-bottom: 4px;
}

.footer p {
  font-size: 12px;
  color: rgba(255, 245, 235, 0.18);
  font-weight: 300;
}

/* =============================================
   BOTTOM LOGOS
   ============================================= */
.bottom-logos {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 20px;
  padding: 0 22px 24px;
}

.bottom-logos-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 40px;
  row-gap: 20px;
}

.bottom-logo-img {
  object-fit: contain;
}

.bottom-logos img[alt="NSFR"] {
  width: min(320px, calc(100vw - 40px));
  height: auto;
}

.bottom-logos img[alt="Κοινωνία της Πληροφορίας"],
.bottom-logos img[alt="Information Society"] {
  height: calc(min(328px, 100vw - 40px) * 205 / 990);
  width: auto;
}

.bottom-logos img.img3 {
  height: min(40px, calc((100vw - 40px) * 40 / 480));
  width: auto;
}

img.bottom-logo-img.img3 {
  height: calc(min(128px, 100vw - 40px) * 205 / 990);
}

.lang-toggle-img {
  display: none;
}

.lang-toggle-img.lang-active {
  display: block;
}

/* =============================================
   APP OVERLAY
   ============================================= */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.app-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.97);
  backdrop-filter: blur(28px);
}

.overlay-content {
  position: absolute;
  inset: 0;
  transform: scale(0.96);
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.app-overlay.active .overlay-content {
  transform: scale(1);
}

#appFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Loading screen */
.overlay-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--deep-ocean);
  z-index: 5;
  transition: opacity 0.3s ease;
}

.overlay-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-ring {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(0, 207, 255, 0.18);
  border-top-color: var(--primary-cyan);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.loading-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 245, 235, 0.3);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Close button */
.overlay-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 0 0 0 16px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, top 0.3s ease, right 0.3s ease, border-radius 0.3s ease;
}

.overlay-close-btn:hover {
  background: #f0f0f0;
  border-color: #ffffff;
  transform: scale(1.1) rotate(90deg);
}

.overlay-close-btn svg {
  width: 20px;
  height: 20px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 720px) {
  :root {
    --card-w: calc(100vw - 40px);
    --card-h: clamp(260px, 56vw, 380px);
    --side-offset: 95vw;
  }

  .arrow-left {
    left: 10px;
  }

  .arrow-right {
    right: 10px;
    left: auto;
  }

  .logo-1, .logo-2 {
    height: 50px;
    width: auto;
  }

  .logo-group {
    margin: 20px auto 40px;
  }
}
