/* === SPOILER STYLES === */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  color: #fff;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.navbar nav {
  display: flex;
  gap: 20px;
}

.navbar nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 8px 16px;
  border-radius: 20px;
}

.navbar nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.navbar nav a:hover {
  color: #fff;
}

/* Spoiler Feed */
.spoiler-feed {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  position: relative;
}

.spoiler-feed::-webkit-scrollbar {
  display: none;
}

.spoiler-feed {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Spoiler Video Item */
.spoiler-item {
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
  margin: 0;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 500px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spoiler-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
}

/* End of Content Indicator */
.end-of-content {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  color: #666;
  padding: 20px;
  background: #000;
  scroll-snap-align: start;
}

.end-of-content i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.end-of-content p {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.end-of-content .subtext {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Video Loading */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.video-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #0090cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Video Controls Overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px 20px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  pointer-events: none;
  z-index: 3;
}

.video-overlay .video-info {
  pointer-events: auto;
}

/* Video Info */
.video-info {
  color: white;
  width: 100%;
  padding-bottom: 20px;
}

.film-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.episode-info {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 12px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.spoiler-description {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Loading Indicator */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-indicator .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #0090cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-indicator p {
  font-size: 1rem;
  font-weight: 500;
}

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

/* Video Play/Pause Overlay */
.play-pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 4;
}

.play-pause-overlay.visible {
  opacity: 1;
}

.play-pause-overlay i {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease;
}

.play-pause-overlay:hover i {
  transform: scale(1.1);
}

/* Progress Bar */
.video-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 6;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0090cc, #00b8ff);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 144, 204, 0.6);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  color: #666;
  padding: 20px;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.empty-state .subtext {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  color: #ff6b6b;
  padding: 20px;
}

.error-state i {
  font-size: 4rem;
  margin-bottom: 20px;
}

.error-state p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.retry-btn {
  background: #0090cc;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.retry-btn:hover {
  background: #0077b3;
  transform: translateY(-2px);
}

/* Scroll Lock */
.scroll-lock {
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 15px;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .navbar nav {
    gap: 15px;
  }
  
  .navbar nav a {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .video-overlay {
    padding: 25px 15px;
  }
  
  .film-title {
    font-size: 1.2rem;
  }
  
  .episode-info {
    font-size: 0.95rem;
  }
  
  .spoiler-description {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }
  
  .play-pause-overlay i {
    font-size: 4rem;
  }
  
  .end-of-content i {
    font-size: 3.5rem;
  }
  
  .end-of-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 12px;
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .navbar nav {
    gap: 10px;
  }
  
  .navbar nav a {
    padding: 5px 10px;
    font-size: 0.85rem;
  }
  
  .video-overlay {
    padding: 20px 12px;
  }
  
  .video-info {
    padding-bottom: 15px;
  }
  
  .film-title {
    font-size: 1.1rem;
  }
  
  .episode-info {
    font-size: 0.9rem;
  }
  
  .spoiler-description {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    margin-bottom: 15px;
  }
  
  .play-pause-overlay i {
    font-size: 3.5rem;
  }
  
  .loading-indicator {
    padding: 30px 25px;
  }
  
  .loading-indicator .spinner {
    width: 40px;
    height: 40px;
  }
  
  .loading-indicator p {
    font-size: 0.9rem;
  }
  
  .end-of-content i {
    font-size: 3rem;
  }
  
  .end-of-content p {
    font-size: 0.95rem;
  }
  
  .end-of-content .subtext {
    font-size: 0.85rem;
  }
}

/* Hide footer on spoiler page */
body:has(.spoiler-feed) footer {
  display: none;
}

/* Prevent text selection */
.spoiler-item {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Smooth transitions */
.spoiler-video,
.video-overlay,
.play-pause-overlay {
  transition: all 0.3s ease;
}

/* === VOLUME BUTTON STYLES === */
.volume-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.volume-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.volume-btn i {
  font-size: 1.2rem;
}

.volume-btn.unmuted {
  background: rgba(0, 144, 204, 0.8);
}

/* Responsive Volume Button */
@media (max-width: 768px) {
  .volume-btn {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }
  
  .volume-btn i {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .volume-btn {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }
  
  .volume-btn i {
    font-size: 1rem;
  }
}