/* ==========================================
   VIDEO DOWNLOAD PAGE (Single Video Detail)
   Modern 2-column layout - puse.lt inspired
   ========================================== */

.video-detail-page {
  padding: 32px 20px 80px 20px;
  background: #f9fafb;
  min-height: calc(100vh - 200px);
  overflow-x: hidden;
  max-width: 100vw;
  box-sizing: border-box;
}

.video-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Breadcrumbs */
.video-breadcrumbs {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.video-breadcrumbs a {
  color: #0C7490;
  text-decoration: none;
  transition: color 0.2s ease;
}

.video-breadcrumbs a:hover {
  color: #0e5c75;
}

/* Main Layout Grid */
.video-detail-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}

/* LEFT COLUMN */
.video-detail-main {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Video Player Section */
.video-player-section {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000000;
}

.video-player-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

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

/* Video Info Section */
.video-info-section {
  padding: 24px;
}

.video-title {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.video-meta-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.video-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6b7280;
}

.video-meta-icon {
  font-size: 16px;
}

/* Description */
.video-description {
  margin-bottom: 24px;
}

.video-description-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-description-text {
  font-size: 15px;
  line-height: 1.7;
  color: #6b7280;
  white-space: pre-wrap;
}

/* Download Links Section */
.video-downloads-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #e5e7eb;
}

.video-downloads-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Download Accordion */
.download-accordion {
  list-style: none;
  padding: 0;
  margin: 0;
}

.download-accordion-item {
  margin-bottom: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.download-accordion-item.active {
  border-color: #0C7490;
}

.download-accordion-header {
  padding: 16px 20px;
  background: #f9fafb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  user-select: none;
}

.download-accordion-header:hover {
  background: #f3f4f6;
}

.download-accordion-item.active .download-accordion-header {
  background: #e0f2f7;
}

.download-format-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.download-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #0C7490;
  color: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.download-format-details {
  font-size: 14px;
  color: #6b7280;
}

.download-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.download-accordion-item.active .download-accordion-content {
  max-height: 500px;
}

.download-accordion-body {
  padding: 20px;
  background: #ffffff;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #0C7490;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(12, 116, 144, 0.3);
}

.download-button:hover {
  background: #0e5c75;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(12, 116, 144, 0.4);
}

.download-button-secondary {
  background: #6b7280;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.download-button-secondary:hover {
  background: #4b5563;
}

/* Progress Bar for Recrawl */
.download-progress {
  padding: 20px;
  text-align: center;
}

.download-progress-title {
  font-size: 16px;
  color: #0C7490;
  font-weight: 600;
  margin-bottom: 16px;
}

.download-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.download-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0C7490 0%, #00d4aa 100%);
  width: 0%;
  transition: width 0.1s linear;
}

.download-progress-text {
  font-size: 14px;
  color: #6b7280;
}

/* RIGHT SIDEBAR */
.video-detail-sidebar {
  position: sticky;
  top: 120px;
}

/* Hide Download Links Section under description */
.video-downloads-section {
  display: none !important;
}

.video-sidebar-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.video-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-stats-grid {
  display: grid;
  gap: 16px;
}

.video-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f9fafb;
  border-radius: 10px;
}

.video-stat-label {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* Download Options Button */
.download-options-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
}

.download-options-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.download-options-btn:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
}

.download-options-btn:active {
  transform: translateY(0);
}

/* Mobile download options - hide on desktop */
.download-options-mobile {
  display: none;
}

/* Desktop download options in sidebar - always visible */
.video-detail-sidebar .download-options-card {
  display: block;
}

/* Quick Download Button */
.quick-download-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #0C7490 0%, #00d4aa 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(12, 116, 144, 0.3);
  margin-top: 16px;
}

.quick-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 116, 144, 0.4);
}

/* Platform Badge */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.platform-badge img {
  height: 20px;
  width: auto;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
  .video-detail-grid {
    grid-template-columns: 1fr 350px;
  }
}

/* Hide breadcrumbs on mobile */
@media (max-width: 960px) {
  .video-breadcrumbs {
    display: none;
  }
}

@media (max-width: 996px) {
  .video-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .video-detail-sidebar {
    position: static;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  
  /* Show mobile download options, hide sidebar download options */
  .download-options-mobile {
    display: block;
    margin: 24px 0;
  }
  
  .video-detail-sidebar .download-options-card {
    display: none;
  }
}

@media (max-width: 768px) {
  .video-detail-page {
    padding: 20px 12px 60px 12px;
    overflow-x: hidden;
  }
  
  .video-detail-container {
    padding: 0;
    width: 100%;
  }
  
  .video-detail-main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .video-title {
    font-size: 22px;
    word-wrap: break-word;
  }
  
  .video-info-section {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
  }
  
  .video-meta-row {
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .download-accordion-header {
    padding: 14px 16px;
  }
  
  .download-format-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Ensure sidebar doesn't overflow on mobile */
  .video-detail-sidebar {
    width: 100%;
    box-sizing: border-box;
  }
  
  .video-sidebar-card {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Video player responsive */
  .video-player-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  .video-player-wrapper iframe {
    width: 100%;
    max-width: 100%;
  }
}

/* ==========================================
   AI Keywords Section
   ========================================== */
.video-keywords-section {
  padding: 24px;
  border-top: 1px solid #e5e7eb;
}

.video-keywords-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
}

.video-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.video-keywords .keyword-tag {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  color: #0C7490;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  border: 1px solid rgba(12, 116, 144, 0.2);
  transition: all 0.2s ease;
  cursor: default;
}

.video-keywords .keyword-tag:hover {
  background: #0C7490;
  color: #ffffff;
  border-color: #0C7490;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(12, 116, 144, 0.3);
}

/* AI Description paragraphs - compact spacing */
.video-description-text p {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.video-description-text p:last-child {
  margin-bottom: 0;
}

/* ==========================================
   NEW DOWNLOAD SYSTEM - Modern UI
   ========================================== */

/* Main Download Box */
.download-box {
  background: linear-gradient(135deg, #0C7490 0%, #00d4aa 100%);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}

.download-box-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.download-main-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 18px 32px;
  background: #ffffff;
  color: #0C7490;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.download-main-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.download-main-btn:active {
  transform: translateY(0);
}

/* Loading State */
.download-loader {
  display: none;
  padding: 32px;
  text-align: center;
}

.download-loader.active {
  display: block;
}

.download-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.download-loader-text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.download-loader-subtext {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin: 8px 0 0 0;
}

/* Results State */
.download-results {
  display: none;
  background: #ffffff;
  border-radius: 16px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.download-results.active {
  display: block;
}

.download-notice {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.download-notice-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.download-notice-text {
  font-size: 14px;
  color: #92400e;
  line-height: 1.5;
  margin: 0;
}

.download-notice-text strong {
  display: block;
  margin-bottom: 4px;
}

/* Download Options List */
.download-options-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.download-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s ease;
}

.download-option:last-child {
  border-bottom: none;
}

.download-option:hover {
  background: #f9fafb;
}

.download-option-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-option-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0C7490 0%, #00d4aa 100%);
  border-radius: 10px;
  font-size: 20px;
}

.download-option-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-option-quality {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.download-option-meta {
  font-size: 13px;
  color: #6b7280;
}

.download-option-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #0C7490;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.download-option-btn:hover {
  background: #0e5c75;
  transform: translateY(-1px);
}

/* Audio option styling */
.download-option.audio-option .download-option-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

/* SaveFrom fallback styling */
.download-option.savefrom-option {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.download-option.savefrom-option .download-option-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.download-option-btn.savefrom-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.download-option-btn.savefrom-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Error State */
.download-error {
  display: none;
  padding: 24px;
  text-align: center;
  color: #ef4444;
}

.download-error.active {
  display: block;
}

.download-error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.download-error-text {
  font-size: 16px;
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .download-box {
    padding: 20px 16px;
    margin: 20px 0;
  }
  
  .download-main-btn {
    width: 100%;
    max-width: none;
    padding: 16px 24px;
    font-size: 16px;
  }
  
  .download-option {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .download-option-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
  
  .download-notice {
    flex-direction: column;
    gap: 8px;
  }
}
