/* ==========================================================================
   ISABELLE SIN KONFIRMASJON - PRESENTASJON STILARK
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,700;1,400&display=swap');

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(18, 22, 34, 0.78);
  --bg-card-hover: rgba(26, 32, 50, 0.88);
  
  --gold-primary: #e6ca65;
  --gold-light: #fef4cf;
  --gold-dark: #b88d1d;
  --gold-gradient: linear-gradient(135deg, #fdf1cd 0%, #d4af37 50%, #9a7611 100%);
  --gold-glow: rgba(212, 175, 55, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #d1d7e3;
  --text-muted: #8893a7;

  --border-glass: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(212, 175, 55, 0.4);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-display: 'Cinzel', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slide: 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-primary);
}

/* ==========================================================================
   HOVEDBEHOLDER OG SCENE
   ========================================================================== */

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #050609;
}

/* Dynamisk bakgrunnsbilde med uskarphet (gir fantastisk dybde på TV/storskjerm) */
.stage-backdrop {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(45px) brightness(0.28) saturate(1.3);
  transform: scale(1.1);
  transition: background-image 0.9s ease-in-out;
  z-index: 1;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(5, 7, 12, 0.85) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Scene der selve bildet/videoen vises */
.stage-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Slide elementer */
.slide-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slide), visibility var(--transition-slide);
  will-change: opacity, transform;
}

.slide-layer.active {
  opacity: 1;
  visibility: visible;
}

/* Bildevisning med valgfri subtil Ken Burns bevegelse */
.slide-image {
  max-width: 95vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 3.5s ease-out;
  transform: scale(1);
}

.slide-layer.active .slide-image.ken-burns {
  transform: scale(1.035);
}

/* Videovisning */
.slide-video-container {
  position: relative;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-video {
  max-width: 95vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  outline: none;
  background: #000;
}

/* Spesiell infokort for intro/outro/plassholder */
.special-card {
  text-align: center;
  padding: 4rem 3rem;
  max-width: 820px;
  background: rgba(14, 18, 28, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-gold);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 50px var(--gold-glow);
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.special-badge {
  display: inline-block;
  padding: 8px 22px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  border-radius: 50px;
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.special-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
  line-height: 1.15;
}

.special-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Bildetekst / Caption nede på skjermen */
.slide-caption-bar {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 13, 20, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  border-radius: 30px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
  transition: opacity var(--transition-fast), transform var(--transition-smooth);
  pointer-events: none;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-caption-bar.hidden {
  opacity: 0;
  transform: translate(-50%, 15px);
}


/* ==========================================================================
   FLYTENDE KONTROLLPANEL (GLASSMORPHIC)
   ========================================================================== */

.control-panel {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 40px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 40;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Skjul kontroller automatisk ved inaktivitet */
.control-panel.auto-hide {
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
}

.ctrl-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.08);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn.btn-play-pause {
  background: var(--gold-gradient);
  color: #121008;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 18px var(--gold-glow);
}

.ctrl-btn.btn-play-pause:hover {
  filter: brightness(1.1);
  transform: scale(1.1);
}

.ctrl-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

/* Slide-teller */
.slide-counter {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 8px;
  min-width: 68px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Tidslinje / Scrubber mini */
.timeline-scrubber {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.timeline-scrubber::-webkit-scrollbar {
  display: none;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.timeline-dot:hover {
  background: var(--gold-light);
  transform: scale(1.4);
}

.timeline-dot.active {
  background: var(--gold-primary);
  width: 22px;
  border-radius: 10px;
  box-shadow: 0 0 8px var(--gold-primary);
}

.timeline-dot.video-dot {
  border: 1px solid var(--gold-primary);
}

/* ==========================================================================
   VELKOMSTSKJERM / OVERLAY (HERO MODAL)
   ========================================================================== */

.modal-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(16, 20, 32, 0.96) 0%, rgba(6, 8, 12, 0.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

.hero-content {
  text-align: center;
  max-width: 680px;
  padding: 2.5rem;
}

.hero-emblem {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.5rem;
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 35px var(--gold-glow);
}

.hero-emblem svg {
  width: 44px;
  height: 44px;
  fill: var(--gold-primary);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.8rem;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

.btn-start-presentation {
  background: var(--gold-gradient);
  color: #110e05;
  border: none;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 18px 46px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 35px var(--gold-glow), 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn-start-presentation:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 45px rgba(212, 175, 55, 0.55);
}

.btn-start-presentation:active {
  transform: translateY(1px);
}

.hero-hints {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-hint-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-hint-item kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--gold-light);
}

/* ==========================================================================
   SLIDE-OVERSIKT / GALLERI-SKUFF (MODAL)
   ========================================================================== */

.gallery-drawer {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: min(90vw, 850px);
  max-height: 50vh;
  background: rgba(13, 17, 26, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.gallery-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-light);
}

.gallery-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #192030;
  transition: all var(--transition-fast);
}

.gallery-item:hover {
  transform: scale(1.05);
  border-color: var(--gold-primary);
}

.gallery-item.active {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.gallery-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
  font-size: 0.68rem;
  padding: 8px 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   PAUSE-OVERLAY INDIKATOR
   ========================================================================== */

.pause-indicator {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 35;
  pointer-events: none;
}

.pause-indicator.visible {
  opacity: 1;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* ==========================================================================
   RESPONSIVITET FOR MOBIL / TABLET
   ========================================================================== */

@media (max-width: 768px) {
  .control-panel {
    bottom: 16px;
    padding: 8px 14px;
    gap: 6px;
  }
  
  .timeline-scrubber {
    display: none;
  }

  .ctrl-btn {
    width: 36px;
    height: 36px;
  }

  .ctrl-btn.btn-play-pause {
    width: 42px;
    height: 42px;
  }

  .slide-caption-bar {
    bottom: 75px;
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}
