/* Play Page Specific Styles */
.play-main {
  padding-top: 220px;
  padding-bottom: 0;
}

.play-hero {
  padding-bottom: 140px;
}

.play-subtitle {
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 640px;
  margin-top: 16px;
}

.play-section {
  padding-bottom: 140px;
}

.photo-section {
  padding-bottom: 80px;
}

/* --- Music Section --- */
.music-container {
  display: grid;
  grid-template-columns: 4fr 6fr; /* 40/60 split */
  gap: 60px;
  align-items: start;
}

/* Record Player with Custom Assets */
.record-player.custom-assets {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
  display: block;
  width: 100%;
  max-width: 550px;
  aspect-ratio: 1632 / 1425;
}

.player-base-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}

#yt-player-container {
  position: absolute;
  width: 200px;
  height: 200px;
  top: -9999px;
  left: -9999px;
  opacity: 0.01;
  z-index: -1;
}

.turntable.custom-turntable {
  position: absolute;
  top: 5%; 
  left: 4.8%; 
  height: 90%; 
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  
  /* Slower spin speed, smooth pause/play */
  animation: spin 12s linear infinite;
  animation-play-state: paused;
}

.record-player.playing .turntable.custom-turntable {
  animation-play-state: running;
}

.vinyl-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.custom-turntable .vinyl-label {
  width: 31%; 
  height: 31%;
  border-radius: 50%;
  position: absolute;
  z-index: 3;
  background: radial-gradient(circle, var(--accent-lavender) 0%, var(--accent-mint) 100%);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.6), 0 0 5px rgba(0,0,0,0.5);
}

.needle-img {
  position: absolute;
  top: 8%; 
  right: 5%; 
  height: 85%; 
  width: auto;
  z-index: 5;
  transform-origin: 50% 12.5%; 
  transform: rotate(-12deg); 
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(-5px 10px 10px rgba(0,0,0,0.5));
}

.record-player.playing .needle-img {
  transform: rotate(22deg);
}

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

/* Tracklist */
.tracklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 10px;
}

.tracklist::-webkit-scrollbar {
  width: 6px;
}
.tracklist::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.tracklist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.tracklist::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.track-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.track-item:hover, .track-item.active {
  background: rgba(255, 255, 255, 0.08);
}

.track-item.active .track-title {
  color: #56f8bb;
}

.track-album-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  margin-right: 15px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.play-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  margin-right: 15px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.play-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.05);
}

.icon-play, .icon-pause {
  width: 20px;
  height: 20px;
}

.icon-pause { display: none; }
.track-item.active .icon-play { display: none; }
.track-item.active .icon-pause { display: block; }

.track-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  margin-right: 15px;
}

.track-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 1.1rem;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-family: var(--font-body, sans-serif);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EQ BARS - Modern Glassmorphic and JS-controlled */
.eq-bars {
  display: none;
  height: 16px;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.track-item.active .eq-bars {
  display: flex;
}

.eq-bar {
  display: block;
  width: 4px;
  height: 16px;
  background: linear-gradient(to top, rgba(255,255,255,0.1), rgba(86, 248, 187, 0.8));
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(86, 248, 187, 0.4);
  backdrop-filter: blur(4px);
  transform-origin: bottom;
  will-change: transform;
  transition: transform 0.12s ease-out; /* Smooth JS transitions */
  transform: scaleY(0.1); /* default rest state */
}

/* No keyframes here! JS will update scaleY randomly while playing */

/* --- Movies Section --- */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
}

.movie-card {
  display: block;
  text-decoration: none;
  background: var(--bg-card-dark);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255,255,255,0.05);
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.2);
}

.movie-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
}

.movie-info {
  padding: 15px;
}

.movie-title {
  font-family: var(--font-heading);
  color: var(--bg-card-white);
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.movie-year {
  font-family: var(--font-body);
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

/* --- Photography Section --- */
.photos-masonry {
  column-count: 3;
  column-gap: 20px;
}

.photo-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
}

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: transform 0.5s ease;
}

.photo-item:hover img {
  transform: scale(1.03);
}

@media (max-width: 900px) {
  .music-container { gap: 30px; } /* Just reduce gap, keep 40/60 row */
  .photos-masonry { column-count: 2; }
}

@media (max-width: 768px) {
  .play-main {
    padding-top: 115px;
    padding-bottom: 0;
  }

  .play-hero {
    padding-bottom: 80px;
    text-align: center;
  }

  .play-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    max-width: 350px;
    margin: 14px auto 0 auto;
    text-align: center;
  }

  .play-section {
    padding-bottom: 90px;
  }

  .photo-section {
    padding-bottom: 60px;
  }

  /* Only stack on smaller tablets/mobile */
  .music-container { grid-template-columns: 1fr; gap: 28px; }
  .record-player.custom-assets { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 600px) {
  .photos-masonry {
    column-count: 2;
    column-gap: 12px;
  }
  .photo-item {
    margin-bottom: 12px;
  }
  .movies-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .music-container { gap: 20px; }
  .record-player.custom-assets { max-width: 250px; margin: 0 auto; transform: none; }
}

@media (max-width: 400px) {
  .record-player.custom-assets { max-width: 220px; }
  .music-container { gap: 16px; }
}

/* --- Photo Modal --- */
.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.photo-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  z-index: 1010;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1) rotate(90deg);
}

.modal-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

.modal-main-image-container {
  max-width: 80vw;
  max-height: 75vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#modal-main-image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}

.modal-nav {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-nav:hover {
  color: white;
  transform: scale(1.2);
}

.modal-nav.prev-btn { margin-right: 20px; }
.modal-nav.next-btn { margin-left: 20px; }

.modal-thumbnails {
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding-bottom: 30px;
}

.modal-thumb {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.modal-thumb:hover {
  opacity: 0.8;
  transform: translateY(-5px);
}

.modal-thumb.active {
  opacity: 1;
  transform: scale(1.15) translateY(-2px);
  border-color: var(--accent-mint);
  box-shadow: 0 10px 20px rgba(86, 248, 187, 0.2);
}

@media (max-width: 768px) {
  .modal-nav { padding: 5px; }
  .modal-main-image-container { max-width: 90vw; }
  .modal-thumb { width: 50px; height: 50px; }
  .modal-close { top: 15px; right: 15px; }
}

/* --- Movie Sort Tabs --- */
.movies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.sort-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px;
  backdrop-filter: blur(10px);
}

.sort-tab {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  padding: 8px 20px;
  border-radius: 25px;
  font-family: var(--font-primary, sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.sort-tab.active {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}


/* --- Skeletons & Fallbacks --- */
.skeleton-wrapper {
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    
    min-height: 20px;
}

.skeleton-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
    z-index: 1;
    pointer-events: none;
}

[data-theme="light"] .skeleton-wrapper, .experience-section .skeleton-wrapper {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .skeleton-wrapper::after, .experience-section .skeleton-wrapper::after {
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 0)
    );
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-wrapper img,
.skeleton-wrapper iframe {
    opacity: 1; /* Fallback to 1 so they don't break */
    transition: opacity 0.3s ease;
}

.skeleton-wrapper.loaded::after {
    display: none;
}

.skeleton-wrapper.loaded {
    background-color: transparent !important;
}

.skeleton-wrapper.loaded img,
.skeleton-wrapper.loaded iframe {
    opacity: 1;
}

/* Fallback state */
.skeleton-wrapper.error::after {
    display: none;
}
.skeleton-wrapper.error {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
}
.skeleton-wrapper.error::before {
    content: 'Image not found';
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}
[data-theme="light"] .skeleton-wrapper.error, .experience-section .skeleton-wrapper.error {
    background-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .skeleton-wrapper.error::before, .experience-section .skeleton-wrapper.error::before {
    color: rgba(0, 0, 0, 0.5);
}


/* --- Scroll Animations --- */
.fade-up-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    
}

.fade-up-element.fade-up-visible {
    opacity: 1;
    transform: none;
}

/* Specific overrides for when JS is disabled */
noscript .fade-up-element {
    opacity: 1;
    transform: none;
}
