/* DeckLab Viewer - Cinematic Pitch Deck Experience */

/* Viewer Body */
.viewer-body {
  background: var(--noir-black);
  overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--noir-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
}

.loading-content .logo {
  font-size: 3rem;
  margin-bottom: 2rem;
  color: var(--accent-gold);
}

.loading-animation {
  margin: 2rem 0;
}

.film-strip {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.frame {
  width: 20px;
  height: 30px;
  background: var(--noir-grey);
  border: 2px solid var(--accent-gold);
  animation: filmFrame 1.5s ease-in-out infinite;
}

.frame:nth-child(2) { animation-delay: 0.2s; }
.frame:nth-child(3) { animation-delay: 0.4s; }
.frame:nth-child(4) { animation-delay: 0.6s; }

@keyframes filmFrame {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

.loading-text {
  font-family: 'JetBrains Mono', monospace;
  color: var(--noir-chrome);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Navigation */
.deck-navigation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

.nav-left, .nav-right {
  flex: 1;
}

.nav-center {
  flex: 2;
  text-align: center;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--noir-chrome);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.back-btn:hover {
  color: var(--accent-gold);
}

.project-info h2 {
  font-size: 1.5rem;
  color: var(--noir-white);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.progress-bar {
  width: 200px;
  height: 3px;
  background: var(--noir-grey);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #f4c842);
  width: 0%;
  transition: width 0.3s ease;
}

.page-counter {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  color: var(--noir-chrome);
  font-size: 0.9rem;
}

/* Main Viewer */
.deck-viewer {
  margin-top: 80px;
  position: relative;
}

.pages-container {
  position: relative;
  /* Remove any default spacing */
  margin: 0;
  padding: 0;
}

/* Page Styling */
.deck-page {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  background: var(--noir-black);
  margin-bottom: 0; /* Remove gaps between pages */
}

.deck-page.title-page {
  background: linear-gradient(135deg, var(--noir-black), var(--noir-dark));
}

.deck-page.content-page {
  background: var(--noir-dark);
}

.page-content {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  position: relative;
  z-index: 2;
}

.page-image {
  width: 100%;
  height: 100vh;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.page-image:hover {
  transform: scale(1.02);
}

/* Video Integration */
.page-video {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.page-video video {
  width: 100%;
  height: auto;
  display: block;
}

/* Video Overlay for Cover Pages */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 1.5s ease-in-out;
}

.video-overlay-center {
  width: 100%;
  height: 100%;
}

.video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  mix-blend-mode: multiply;
}

/* Video Intro Sequence */
.video-intro-sequence {
  opacity: 0; /* Start hidden */
  z-index: 5; /* Start above everything */
  transition: opacity 1s ease-in-out;
}

.video-intro-sequence.fading {
  opacity: 0;
  z-index: 2; /* Fade behind content */
}

/* Ensure cover pages with video start black */
.deck-page.title-page:has(.video-overlay) {
  background: var(--noir-black) !important;
}

.video-overlay-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--accent-gold);
  font-size: 3rem;
  opacity: 0.5;
}

/* Ensure page content stays above video overlay */
.page-content {
  position: relative;
  z-index: 3;
}

.page-meta {
  z-index: 4;
}

/* Page Metadata */
.page-meta {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 3;
}

.page-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-gold);
  background: var(--glass-bg);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

.page-title {
  font-size: 1.2rem;
  color: var(--noir-white);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Scroll Indicator */
.scroll-indicator {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.scroll-line {
  width: 2px;
  height: 100px;
  background: var(--noir-grey);
  position: relative;
}

.scroll-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: top 0.3s ease;
}

.scroll-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--noir-light-grey);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Error State */
.error-state {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--noir-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.error-state.hidden {
  display: none;
}

.error-content {
  text-align: center;
  max-width: 500px;
  padding: 2rem;
}

.error-content i {
  font-size: 4rem;
  color: var(--accent-red);
  margin-bottom: 1.5rem;
}

.error-content h2 {
  font-size: 2rem;
  color: var(--noir-white);
  margin-bottom: 1rem;
}

.error-content p {
  color: var(--noir-chrome);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.return-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent-gold);
  color: var(--noir-black);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.return-btn:hover {
  background: #f4c842;
  transform: translateY(-2px);
}

/* Parallax Effects */
.parallax-element {
  transition: transform 0.1s ease-out;
}

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

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

/* CINEMATIC EFFECTS - PROJECT SPECIFIC */

/* BubbleGum Project - Breathing Silhouettes */
.bubblegum-project .page-image {
  position: relative;
  overflow: hidden;
}

.bubblegum-project .page-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 2px, transparent 3px),
    radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.015) 1.5px, transparent 2.5px),
    radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.01) 2px, transparent 3px),
    radial-gradient(circle at 80% 35%, rgba(255, 255, 255, 0.02) 1px, transparent 2px),
    radial-gradient(circle at 15% 70%, rgba(255, 255, 255, 0.015) 1.5px, transparent 2.5px);
  animation: breathingSilhouettes 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes breathingSilhouettes {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0.7;
    transform: scale(1.005);
  }
}

.bubblegum-project .page-image:hover::after {
  animation-duration: 2s;
}

/* Additional subtle movement for BubbleGum */
.bubblegum-project .page-image {
  animation: subtleFloat 6s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  33% { transform: translateY(-2px) scale(1.001); }
  66% { transform: translateY(1px) scale(0.999); }
}

/* N4H Project - Blinking Eye Effect */
.n4h-project .page-image {
  position: relative;
  overflow: hidden;
}

.n4h-project .page-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 45%,
    rgba(139, 69, 19, 0.8) 48%,
    rgba(139, 69, 19, 0.9) 50%,
    rgba(139, 69, 19, 0.8) 52%,
    transparent 55%,
    transparent 100%
  );
  opacity: 0;
  animation: eyeBlink 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes eyeBlink {
  0%, 94%, 100% { 
    opacity: 0;
    transform: scaleY(0);
  }
  95%, 98% { 
    opacity: 1;
    transform: scaleY(1);
  }
}

/* Pupil dilation effect for N4H */
.n4h-project .page-image::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.3) 30%,
    transparent 35%
  );
  transform: translate(-50%, -50%);
  animation: pupilDilation 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes pupilDilation {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  25% { 
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.8;
  }
  50% { 
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.4;
  }
  75% { 
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.7;
  }
}

/* Hover effects for both projects */
.bubblegum-project .page-image:hover {
  transform: scale(1.02) !important;
  filter: brightness(1.1) contrast(1.05);
  transition: all 0.5s ease;
}

.n4h-project .page-image:hover {
  transform: scale(1.02) !important;
  filter: brightness(1.1) contrast(1.1) saturate(1.2);
  transition: all 0.5s ease;
}

.n4h-project .page-image:hover::before {
  animation-duration: 2s;
}

.n4h-project .page-image:hover::after {
  animation-duration: 4s;
}

/* Cinematic Scroll Effects */
.cinematic-reveal {
  opacity: 0;
  transform: translateY(50px) rotateX(10deg);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cinematic-reveal.revealed {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* Film Grain Enhancement */
.deck-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, transparent 20%, rgba(255,255,255,0.01) 21%, rgba(255,255,255,0.01) 34%, transparent 35%),
    linear-gradient(0deg, transparent 24%, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.02) 26%, transparent 27%);
  opacity: 0.4;
  animation: filmGrain 0.3s steps(8) infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes filmGrain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-1%, -1%); }
  30% { transform: translate(1%, -1%); }
  50% { transform: translate(-1%, 1%); }
  70% { transform: translate(1%, 1%); }
  90% { transform: translate(-1%, -1%); }
}

/* Depth layering for parallax */
.page-image.parallax-element {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Cinematic Transitions */
.page-transition {
  position: relative;
  overflow: hidden;
}

.page-transition::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.1) 50%,
    transparent 100%
  );
  animation: cinematicWipe 2s ease-in-out;
  pointer-events: none;
  z-index: 3;
}

@keyframes cinematicWipe {
  0% { left: -100%; }
  50% { left: 0%; }
  100% { left: 100%; }
}

/* ENHANCED SCROLL EFFECTS */
.page-image {
  will-change: transform, filter;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Voyeuristic Effects for N4H */
.n4h-project .voyeur-cursor {
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

/* BubbleGum Atmospheric Effects */
.bubblegum-project .deck-page {
  background: 
    radial-gradient(ellipse at top, rgba(26, 26, 26, 0.9) 0%, var(--noir-black) 70%),
    linear-gradient(135deg, var(--noir-black) 0%, rgba(42, 42, 42, 0.5) 100%);
}

/* Dynamic Lighting Effects */
@keyframes atmosphericLighting {
  0%, 100% { 
    box-shadow: 
      0 0 50px rgba(212, 175, 55, 0.1),
      inset 0 0 50px rgba(0, 0, 0, 0.2);
  }
  50% { 
    box-shadow: 
      0 0 80px rgba(212, 175, 55, 0.15),
      inset 0 0 30px rgba(0, 0, 0, 0.3);
  }
}

.page-image.parallax-element {
  animation: atmosphericLighting 8s ease-in-out infinite;
}

/* Loading Enhancement */
.loading-screen {
  background: 
    radial-gradient(ellipse at center, rgba(26, 26, 26, 0.9) 0%, var(--noir-black) 70%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="90" cy="50" r="0.3" fill="rgba(255,255,255,0.01)"/><circle cx="50" cy="90" r="0.4" fill="rgba(255,255,255,0.015)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

/* Enhanced Navigation */
.deck-navigation {
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.progress-fill {
  background: linear-gradient(90deg, 
    var(--accent-gold) 0%, 
    #f4c842 50%, 
    var(--accent-gold) 100%);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Micro-interactions */
.page-number {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.page-number::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
  transition: left 0.5s ease;
}

.page-number:hover::before {
  left: 100%;
}

.page-number:hover {
  transform: scale(1.05);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .deck-navigation {
    padding: 0 1rem;
  }
  
  .nav-center {
    flex: 3;
  }
  
  .project-info h2 {
    font-size: 1.2rem;
  }
  
  .progress-bar {
    width: 150px;
  }
}

@media (max-width: 768px) {
  .deck-navigation {
    height: 70px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-left, .nav-right {
    flex: none;
  }
  
  .nav-center {
    flex: none;
    width: 100%;
    order: -1;
  }
  
  .deck-viewer {
    margin-top: 70px;
  }
  
  .deck-page {
    padding: 1rem;
  }
  
  .scroll-indicator {
    right: 1rem;
  }
  
  .scroll-hint {
    display: none;
  }
  
  .page-meta {
    top: 1rem;
    left: 1rem;
  }
}

@media (max-width: 480px) {
  .deck-navigation {
    padding: 0 0.5rem;
  }
  
  .project-info h2 {
    font-size: 1rem;
  }
  
  .progress-bar {
    width: 120px;
  }
  
  .back-btn span {
    display: none;
  }
  
  .page-counter {
    font-size: 0.8rem;
  }
}