/* Custom CSS for Muted Score Website - Canvas-Free Implementation */

/* ============================================
   BASE STYLES
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  background-color: #000 !important;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #000 !important;
}

/* ============================================
   FIX BROKEN BLOB URLs
   ============================================ */

img[src^="blob:"] {
  display: none !important;
}

/* ============================================
   CANVAS-STYLE ANIMATIONS
   ============================================ */

/* Elements with IwXXkw class (Canvas animation class) */
.IwXXkw {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.IwXXkw.animated {
  opacity: 1 !important;
}

/* Smooth transitions for all animated elements */
[data-scroll-ready="true"] [style*="opacity: 0"],
[data-scroll-ready="true"] [style*="opacity:0"] {
  will-change: opacity, transform;
}

/* Homepage image animations */
.DF_utQ img._7_i_XA,
.DF_utQ img.t1Akgg {
  will-change: opacity, transform;
}

/* Text animation containers */
.DF_utQ.animated-text {
  will-change: opacity, transform;
}

/* ============================================
   Z-INDEX STACKING - SIMPLE AND RELIABLE
   ============================================ */

/* Sections need proper stacking context */
section[data-scroll-ready="true"] {
  position: relative;
  z-index: 0;
}

/* Numbers behind everything (z-index: 1) */
.DF_utQ._682gpw._0xkaeQ[data-element-type="number"] {
  z-index: 1 !important;
}

/* Images in middle (z-index: 10) */
.DF_utQ._682gpw._0xkaeQ[data-element-type="image"] {
  z-index: 10 !important;
}

/* Text in front (z-index: 20) */
.DF_utQ._682gpw._0xkaeQ[data-element-type="text"] {
  z-index: 20 !important;
}

/* ============================================
   ENSURE CONTENT VISIBILITY
   ============================================ */

/* Ensure text containers don't clip content */
.DF_utQ._682gpw._0xkaeQ[data-element-type="text"] {
  overflow: visible !important;
}

/* Ensure all text is readable and not hidden */
.DF_utQ._682gpw._0xkaeQ[data-element-type="text"] * {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* ============================================
   YOUTUBE EMBED CONTAINER
   ============================================ */

.youtube-embed-wrapper {
  position: relative;
  overflow: hidden;
}

.youtube-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* Ensure video elements can receive pointer events */
video {
  pointer-events: auto !important;
  z-index: 100 !important;
}

/* Ensure video container can receive pointer events */
.DF_utQ video {
  pointer-events: auto !important;
}

/* Fix pointer-events on video parent containers */
.DF_utQ:has(video) {
  pointer-events: auto !important;
}

.DF_utQ:has(video) > * {
  pointer-events: auto !important;
}

/* ============================================
   CUSTOM VIDEO PLAYER - PROFESSIONAL STYLING
   ============================================ */

.custom-video-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.custom-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

/* Show thumbnail (poster) as background when paused AND video hasn't been played yet */
.custom-video-player.paused:not(.has-played) .custom-video {
  opacity: 0;
}

/* Show video frame when paused after it has been played */
.custom-video-player.paused.has-played .custom-video {
  opacity: 1;
}

.custom-video-player.playing .custom-video {
  opacity: 1;
}

/* Hide background thumbnail when playing */
.custom-video-player.playing {
  background-image: none !important;
}

/* Hide default controls completely */
.custom-video::-webkit-media-controls {
  display: none !important;
}

.custom-video::-webkit-media-controls-enclosure {
  display: none !important;
}

.custom-video::-webkit-media-controls-panel {
  display: none !important;
}

.custom-video::-webkit-media-controls-play-button {
  display: none !important;
}

.custom-video::-webkit-media-controls-timeline {
  display: none !important;
}

.custom-video::-webkit-media-controls-current-time-display {
  display: none !important;
}

.custom-video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

.custom-video::-webkit-media-controls-mute-button {
  display: none !important;
}

.custom-video::-webkit-media-controls-volume-slider {
  display: none !important;
}

.custom-video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Centered Play Button */
.custom-center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 5;
  color: #fff;
  opacity: 1;
}

.custom-center-play-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(1.1);
}

.custom-center-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px; /* Slight offset for visual centering */
}

.custom-video-player.playing .custom-center-play-btn {
  opacity: 0;
  pointer-events: none;
}

.custom-video-player.paused .custom-center-play-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Custom Controls Container */
.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: auto !important;
}

/* Ensure all controls can receive clicks */
.custom-video-controls * {
  pointer-events: auto !important;
}

.custom-center-play-btn {
  pointer-events: auto !important;
  z-index: 15 !important;
}

.custom-video-player:hover .custom-video-controls,
.custom-video-player.playing .custom-video-controls,
.custom-video-player.controls-visible .custom-video-controls {
  opacity: 1;
}

/* Time Display */
.custom-time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  letter-spacing: 0.5px;
  min-width: 80px;
  flex-shrink: 0;
}

.custom-time-separator {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 2px;
}

/* Progress Bar Container */
.custom-progress-container {
  flex: 1;
  height: 6px;
  position: relative;
  cursor: pointer;
  margin: 0 8px;
  pointer-events: auto !important;
  z-index: 20;
}

.custom-progress-bar {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  position: relative;
  overflow: visible;
  pointer-events: auto !important;
}

.custom-progress-filled {
  height: 100%;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
  border-radius: 3px;
  width: 0%;
  position: relative;
  will-change: width;
  transition: none;
}

.custom-video-player.playing .custom-progress-filled {
  transition: none;
}

.custom-progress-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  will-change: left;
}

.custom-video-player.playing .custom-progress-handle {
  transition: none;
}

.custom-video-player:hover .custom-progress-handle {
  opacity: 1;
}

.custom-progress-container:hover .custom-progress-handle {
  opacity: 1;
}

/* Volume Button */
.custom-volume-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.custom-volume-btn:hover {
  color: #fff;
}

.custom-volume-btn svg {
  width: 20px;
  height: 20px;
}

.custom-volume-btn .mute-icon {
  display: none;
}

.custom-video-player.muted .custom-volume-btn .volume-icon {
  display: none;
}

.custom-video-player.muted .custom-volume-btn .mute-icon {
  display: block;
}

/* Volume Slider Container */
.custom-volume-container {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
}

.custom-video-player:hover .custom-volume-container,
.custom-volume-container:hover {
  width: 80px;
}

.custom-volume-slider {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.custom-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.custom-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Fullscreen Button */
.custom-fullscreen-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.custom-fullscreen-btn:hover {
  color: #fff;
}

.custom-fullscreen-btn svg {
  width: 18px;
  height: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .custom-video-controls {
    padding: 12px 16px 12px;
    gap: 12px;
  }
  
  .custom-time-display {
    font-size: 12px;
    min-width: 70px;
  }
  
  .custom-volume-container {
    display: none;
  }
  
  .custom-center-play-btn {
    width: 70px;
    height: 70px;
  }
  
  .custom-center-play-btn svg {
    width: 28px;
    height: 28px;
  }
}

/* Fullscreen Styles */
.custom-video-player.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
}

.custom-video-player.fullscreen .custom-video {
  object-fit: contain;
}

/* ============================================
   END CUSTOM VIDEO PLAYER
   ============================================ */


/* Navigation link hover */
nav.jDe9Eg a.Ej7lEg {
  transition: opacity 0.3s ease;
}

nav.jDe9Eg a.Ej7lEg:hover {
  opacity: 0.7;
}

/* Link hover effects */
a:not(nav a) {
  transition: opacity 0.3s ease;
}

a:not(nav a):hover {
  opacity: 0.8;
}

/* ============================================
   MOBILE RESPONSIVENESS - REDONE PROPERLY
   ============================================ */

/* Hamburger Menu Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:active {
  background: rgba(0, 0, 0, 1);
  transform: scale(1.05);
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation - Slide In Animation */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Navigation - hidden by default, slides in from right */
  nav.jDe9Eg {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.98) !important;
    padding: 80px 30px 30px !important;
    z-index: 9999 !important;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    pointer-events: auto !important;
  }
  
  nav.jDe9Eg.mobile-open {
    right: 0 !important;
    pointer-events: auto !important;
  }
  
  nav.jDe9Eg ul.DBPC9g {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  
  nav.jDe9Eg li.KJpqkQ {
    width: 100% !important;
    margin: 0 !important;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto !important;
  }
  
  nav.jDe9Eg.mobile-open li.KJpqkQ {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto !important;
  }
  
  nav.jDe9Eg.mobile-open li.KJpqkQ:nth-child(1) { transition-delay: 0.1s; }
  nav.jDe9Eg.mobile-open li.KJpqkQ:nth-child(2) { transition-delay: 0.15s; }
  nav.jDe9Eg.mobile-open li.KJpqkQ:nth-child(3) { transition-delay: 0.2s; }
  nav.jDe9Eg.mobile-open li.KJpqkQ:nth-child(4) { transition-delay: 0.25s; }
  nav.jDe9Eg.mobile-open li.KJpqkQ:nth-child(5) { transition-delay: 0.3s; }
  
  nav.jDe9Eg a.Ej7lEg {
    width: 100% !important;
    padding: 18px 20px !important;
    font-size: 16px !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    display: block !important;
    pointer-events: auto !important;
    z-index: 10000 !important;
    position: relative;
  }
  
  nav.jDe9Eg a.Ej7lEg:hover,
  nav.jDe9Eg a.Ej7lEg:active,
  nav.jDe9Eg a.Ej7lEg:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    padding-left: 25px !important;
    transform: translateX(5px);
    pointer-events: auto !important;
  }
  
  /* Overlay when menu is open */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
  }
  
  .mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Sections - ensure full visibility */
  section[data-scroll-ready="true"] {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    position: relative;
  }
  
  /* Main container - better scaling without cutting off */
  ._8jGYJw {
    width: 100vw !important;
    max-width: 100vw !important;
    transform: scale(0.85) !important;
    transform-origin: top center !important;
    transition: transform 0.3s ease;
    overflow: visible !important;
  }
  
  /* Images - ensure they're fully visible and responsive */
  .DF_utQ img._7_i_XA,
  .DF_utQ img.t1Akgg,
  .DF_utQ img.dMHlHA {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
  }
  
  /* Image containers - prevent clipping */
  .DF_utQ._682gpw._0xkaeQ[data-element-type="image"],
  .DF_utQ._682gpw._0xkaeQ:has(img) {
    overflow: visible !important;
    max-width: 100vw !important;
  }
  
  /* Ensure all image parent containers don't clip */
  .DF_utQ:has(img._7_i_XA),
  .DF_utQ:has(img.t1Akgg),
  .DF_utQ:has(img.dMHlHA),
  .Zp7NQw,
  .NI12hw {
    overflow: visible !important;
  }
  
  /* Text - ensure readability */
  .DF_utQ._682gpw._0xkaeQ[data-element-type="text"] {
    max-width: 95vw !important;
    overflow: visible !important;
  }
  
  /* Video player - mobile optimized */
  .custom-video-player {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0;
  }
  
  /* YouTube embeds - responsive */
  .youtube-embed-wrapper {
    width: 100% !important;
    max-width: 95vw !important;
  }
  
  /* Ensure navigation links are always clickable */
  nav.jDe9Eg a.Ej7lEg,
  nav.jDe9Eg a.Ej7lEg * {
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  
  /* Ensure no elements block navigation */
  nav.jDe9Eg li.KJpqkQ,
  nav.jDe9Eg li.KJpqkQ * {
    pointer-events: auto !important;
  }
  
  /* Touch-friendly tap targets */
  a, button {
    min-height: 44px !important;
    min-width: 44px !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  }
  
  /* Prevent text selection on tap */
  * {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    -webkit-touch-callout: none;
  }
  
  /* Allow text selection for actual text content */
  p, span, div[data-element-type="text"] {
    -webkit-touch-callout: default;
  }
}

/* Tablet and below */
@media (max-width: 1024px) {
  section[data-scroll-ready="true"] {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  ._8jGYJw {
    max-width: 100vw !important;
    overflow: visible !important;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .mobile-menu-toggle {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  nav.jDe9Eg {
    width: 260px !important;
  }
  
  /* Scale down content more on very small screens */
  ._8jGYJw {
    transform: scale(0.75) !important;
  }
  
  /* Text elements - smaller but readable */
  .DF_utQ._682gpw._0xkaeQ[data-element-type="text"] ._28USrA {
    font-size: clamp(12px, 4vw, 20px) !important;
    line-height: 1.4 !important;
  }
  
  /* Number elements - smaller */
  .DF_utQ._682gpw._0xkaeQ[data-element-type="number"] ._28USrA {
    font-size: clamp(28px, 8vw, 50px) !important;
  }
  
  /* Title headings */
  .DF_utQ._682gpw._0xkaeQ[data-element-type="text"] p._28USrA.GEC0sA.XN6uKA._4N4NA {
    font-size: clamp(16px, 5vw, 24px) !important;
  }
  
  /* Ensure images are visible */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  ._8jGYJw {
    transform: scale(0.7) !important;
  }
  
  section[data-scroll-ready="true"] {
    min-height: auto;
  }
  
  nav.jDe9Eg {
    width: 300px !important;
  }
}

/* Large screens - center content */
@media (min-width: 1921px) {
  section[data-scroll-ready="true"] {
    max-width: 1920px;
    margin: 0 auto;
  }
}
