/* Video Player Container - Inline in content */
.video-player-container {
  margin: 1rem 0;
  background: #000;
  border: 2px solid #333;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(101, 100, 100, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top center;
}

/* Sticky behavior on scroll - scale down to save space */
.video-player-container.sticky {
  position: fixed;
  top: 1rem;
  z-index: 100;
  margin-bottom: 2rem;
  border-color: #1a73e8;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(26, 115, 232, 0.3);
  transform: scale(0.6);
  transform-origin: top right;
  right: 2rem;
  /*margin-right: -25%; *//* Compensate for scale: (1-0.75)/2 * 100% */
}
.video-player-container.sticky:hover {
  width: 500px;
  transform: scale(1);
}
/* Prevent layout shift when going sticky */
.video-player-sticky-spacer {
  display: none;
}

.video-player-container.sticky ~ .video-player-sticky-spacer {
  display: block;
}

/* Tab Navigation */
.video-player-tabs {
  display: flex;
  align-items: center;
  background: #0a0a0a;
  border-bottom: 2px solid #1a1a1a;
  gap: 0;
}

.video-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.video-tab svg {
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}

.video-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #aaa;
}

.video-tab.active {
  color: #fff;
  background: rgba(26, 115, 232, 0.1);
  border-bottom-color: var(--primary, #1a73e8);
}

.video-tab.active svg {
  color: var(--primary, #1a73e8);
}

.video-player-controls {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  padding-right: 0.75rem;
  border-left: 1px solid #1a1a1a;
  margin-left: auto;
  padding-left: 0.75rem;
}

.video-player-controls button {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.video-player-controls button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.video-player-controls button.active {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}

.video-player-controls button svg {
  width: 18px;
  height: 18px;
}

/* Content Area */
.video-player-content {
  position: relative;
  background: #000;
}

.video-tab-content {
  display: none;
}

.video-tab-content.active {
  display: block;
}

/* Video Wrapper */
.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
}

.video-load-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 2rem 3rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-load-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary, #1a73e8);
  transform: scale(1.05);
}

.video-load-btn svg {
  width: 64px;
  height: 64px;
  color: var(--primary, #1a73e8);
}

.video-load-btn span {
  font-size: 1rem;
  font-weight: 500;
}

.video-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.video-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Translation Content */
.translation-content-wrapper {
  padding: 1.5rem;
  background: #0a0a0a;
  max-height: 500px;
  overflow-y: auto;
  border-top: 1px solid #1a1a1a;
}

.translation-lines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.translation-line {
  padding: 1rem;
  background: #0f0f0f;
  border-radius: 0.375rem;
  border-left: 3px solid #1a1a1a;
  transition: all 0.25s ease;
  cursor: pointer;
}

.translation-line:hover {
  background: #141414;
  border-left-color: rgba(26, 115, 232, 0.5);
  transform: translateX(2px);
}

.translation-line.active {
  background: rgba(26, 115, 232, 0.08);
  border-left-color: var(--primary, #1a73e8);
  box-shadow: 0 0 20px rgba(26, 115, 232, 0.15);
}

.translation-time {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--primary, #1a73e8);
  background: rgba(26, 115, 232, 0.15);
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.translation-text {
  color: #999;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.translation-line.active .translation-text {
  color: #e0e0e0;
}

.translation-line.active .translation-time {
  background: var(--primary, #1a73e8);
  color: #000;
}

/* Timestamp links in content */
.video-timestamp {
  color: var(--primary, #1a73e8);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed currentColor;
  transition: all 0.2s ease;
  cursor: pointer;
}

.video-timestamp:hover {
  color: var(--primary-hover, #1557b0);
  border-bottom-style: solid;
}


/* Sync mode indicator */
.sync-btn.active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
  .video-player-container.sticky {
    /* No scaling on mobile - keep full width */
    transform: scale(1);
    margin-right: 0;
    position: static;
  }
  
  .video-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }
  
  .video-tab svg {
    width: 16px;
    height: 16px;
  }
  
  .translation-content-wrapper {
    padding: 1rem;
    max-height: 400px;
  }
  
  .translation-line {
    padding: 0.75rem;
  }
  
  .video-load-btn {
    padding: 1.5rem 2rem;
  }
  
  .video-load-btn svg {
    width: 48px;
    height: 48px;
  }
}

/* Medium screens - less aggressive scaling */
@media (min-width: 769px) and (max-width: 1024px) {
  .video-player-container.sticky {
    /*transform: scale(0.85);
    margin-right: -7.5%;*/
  }
}

/* Large screens - more aggressive scaling possible */
@media (min-width: 1400px) {
  .video-player-container.sticky {
    /*transform: scale(0.65);
    margin-right: -17.5%;*/
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .video-player-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  .video-player-container.sticky {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* Scrollbar styling for translation panel */
.translation-content-wrapper::-webkit-scrollbar {
  width: 10px;
}

.translation-content-wrapper::-webkit-scrollbar-track {
  background: #0a0a0a;
  border-left: 1px solid #1a1a1a;
}

.translation-content-wrapper::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
  border: 2px solid #0a0a0a;
}

.translation-content-wrapper::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Sync sections */
.sync-section {
  scroll-margin-top: 6rem;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  margin-top: 1rem;
  border: 2px solid transparent;
  padding: .75rem;
}

.sync-section.active {
  background: rgba(26, 115, 232, 0.05);
  border: 2px solid var(--primary, #1a73e8);
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(26, 115, 232, 0.15);
}

/* Sync section header with heading and play button */
.sync-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sync-section-heading {
  margin: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 600;
  flex: 1;
}

/* Sync section play button */
.sync-section-play {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(26, 115, 232, 0.1);
  border: 1px solid rgba(26, 115, 232, 0.3);
  color: var(--primary, #1a73e8);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sync-section-play:hover {
  background: rgba(26, 115, 232, 0.2);
  border-color: var(--primary, #1a73e8);
  transform: translateY(-1px);
}

.sync-section-play svg {
  width: 16px;
  height: 16px;
}

/* Standalone play button (without heading) */
.sync-section-play-standalone {
  margin-bottom: 1rem;
}

/* Active state */
.sync-section.active .sync-section-play {
  background: var(--primary, #1a73e8);
  color: #fff;
  border-color: var(--primary, #1a73e8);
}

/* Responsive */
@media (max-width: 768px) {
  .sync-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sync-section-play {
    align-self: flex-start;
  }
}