/**
 * Стили для виджета видеосвязей карточек
 * Адаптивный дизайн с поддержкой темной и светлой тем
 */

.video-widget {
  background: var(--card-bg, linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%));
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  transition: all 0.3s ease;
}

.video-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Header */
.video-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-color, #6b73ff);
}

.video-widget-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color, #2d3748);
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-widget-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.loading-indicator {
  color: var(--accent-color, #6b73ff);
  animation: pulse 1.5s ease-in-out infinite;
}

.references-count {
  background: var(--accent-color, #6b73ff);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Content */
.video-widget-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-references-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Video Reference */
.video-reference {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid var(--accent-color, #6b73ff);
  transition: all 0.2s ease;
}

.video-reference:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateX(4px);
}

.video-reference-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color, #2d3748);
  line-height: 1.3;
  flex: 1;
}

.similarity-badge {
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.similarity-badge.strong {
  background: #d4edda;
  color: #155724;
}

.similarity-badge.medium {
  background: #fff3cd;
  color: #856404;
}

.similarity-badge.weak {
  background: #f8d7da;
  color: #721c24;
}

.video-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--secondary-text, #718096);
  font-size: 14px;
}

.channel {
  font-weight: 500;
  color: var(--accent-color, #6b73ff);
}

.time-mark {
  font-family: 'Courier New', monospace;
  background: rgba(107, 115, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.fragment-preview {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-color, #4a5568);
  font-style: italic;
}

/* Actions */
.video-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.video-actions button {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.watch-btn.primary {
  background: var(--accent-color, #6b73ff);
  color: white;
}

.watch-btn.primary:hover {
  background: var(--accent-color-dark, #5a67f7);
  transform: translateY(-1px);
}

.expand-btn.secondary {
  background: transparent;
  color: var(--accent-color, #6b73ff);
  border: 1px solid var(--accent-color, #6b73ff);
}

.expand-btn.secondary:hover {
  background: var(--accent-color, #6b73ff);
  color: white;
}

/* Full Fragment Text */
.fragment-full {
  margin-top: 8px;
  padding: 12px;
  background: rgba(107, 115, 255, 0.05);
  border-radius: 6px;
  border-left: 3px solid var(--accent-color, #6b73ff);
}

.fragment-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color, #2d3748);
  margin-bottom: 8px;
}

.fragment-meta {
  color: var(--secondary-text, #718096);
  font-size: 12px;
}

/* Widget Actions */
.video-widget-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.show-more-btn {
  background: transparent;
  color: var(--accent-color, #6b73ff);
  border: 2px dashed var(--accent-color, #6b73ff);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.show-more-btn:hover {
  background: var(--accent-color, #6b73ff);
  color: white;
  border-style: solid;
}

/* Error State */
.video-widget-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid #dc3545;
  font-size: 14px;
}

.no-references {
  text-align: center;
  padding: 24px;
  color: var(--secondary-text, #718096);
  font-style: italic;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-reference {
  animation: fadeInUp 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-widget {
    padding: 12px;
    margin: 12px 0;
  }
  
  .video-widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .video-widget-title {
    font-size: 16px;
  }
  
  .video-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .similarity-badge {
    align-self: flex-start;
  }
  
  .video-actions {
    justify-content: space-between;
  }
  
  .video-actions button {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .video-widget {
    padding: 8px;
  }
  
  .video-reference {
    padding: 8px;
  }
  
  .video-actions {
    flex-direction: column;
  }
  
  .video-meta {
    flex-direction: column;
    gap: 4px;
  }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
  .video-widget {
    --card-bg: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --text-color: #e2e8f0;
    --secondary-text: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);
  }
  
  .video-reference {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .video-reference:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .fragment-full {
    background: rgba(107, 115, 255, 0.1);
  }
}

/* Integration with existing Vrajalila themes */
.vrajalila-card .video-widget {
  margin-top: 20px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .video-widget {
    border-width: 2px;
  }
  
  .video-reference {
    border-left-width: 6px;
  }
  
  .similarity-badge {
    border: 1px solid currentColor;
  }
}