/**
 * Video Tab Styles — goal-based UX
 */

/* ===== VIDEO TAB CONTENT ===== */
/* NOTE: Do NOT set display without .active - it's controlled by .tab-content.active in layout.css */
#tab-video.active {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== VIDEO GOAL SELECTION ===== */
.video-goals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-goal-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-align: left;
  color: var(--text-primary);
}

.video-goal-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.video-goal-btn:active {
  transform: scale(0.98);
}

.video-goal-btn.video-goal-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: auto;
}

.video-goal-btn.video-goal-disabled:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.08);
}

.video-goal-btn.video-goal-disabled:active {
  transform: none;
}

.goal-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.goal-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.goal-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-primary);
}

.goal-desc {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ===== VIDEO FORM SCREEN ===== */
#videoFormScreen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== VIDEO BACK BUTTON ===== */
.video-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 4px;
}

.video-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ===== VIDEO PROMPT ===== */
.video-prompt-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-prompt-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

#videoPrompt {
  width: 100%;
  min-height: 80px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 12px;
  padding-right: 80px; /* Место для кнопок копировать/очистить */
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

#videoPrompt:focus {
  outline: none;
  border-color: var(--accent-primary);
}

#videoPrompt::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ===== VIDEO IMAGE UPLOAD ===== */
.video-image-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-image-upload {
  position: relative;
  width: 100%;
  min-height: 120px;
  background: var(--bg-secondary);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.video-image-upload:hover {
  border-color: var(--accent-primary);
  background: rgba(106, 106, 255, 0.05);
}

.video-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.video-image-placeholder .upload-icon {
  font-size: 32px;
  opacity: 0.5;
}

.video-image-placeholder .upload-text {
  font-size: 13px;
}

.video-image-placeholder .upload-hint {
  font-size: 11px;
  opacity: 0.5;
}

#videoImagePreview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  display: none;
}

.video-image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.video-image-remove:hover {
  background: rgba(255, 50, 50, 0.8);
}

/* ===== VIDEO REFERENCE UPLOAD (Motion Control) ===== */
.video-ref-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-ref-upload {
  position: relative;
  width: 100%;
  min-height: 120px;
  background: var(--bg-secondary);
  border: 2px dashed rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.video-ref-upload:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.05);
}

.video-ref-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.video-ref-placeholder .upload-icon {
  font-size: 32px;
  opacity: 0.5;
}

.video-ref-placeholder .upload-text {
  font-size: 13px;
}

.video-ref-placeholder .upload-hint {
  font-size: 11px;
  opacity: 0.5;
}

#videoRefPreview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  display: none;
}

.video-ref-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.video-ref-remove:hover {
  background: rgba(255, 50, 50, 0.8);
}

/* ===== VIDEO SETTINGS ===== */
.video-settings-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-settings-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-setting-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.video-setting-select {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  min-width: 100px;
}

.video-setting-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.video-mode-badge {
  font-size: 12px;
  color: var(--accent-primary);
  padding: 4px 10px;
  background: rgba(106, 106, 255, 0.12);
  border-radius: 12px;
  font-weight: 500;
}

/* ===== VIDEO COST ROW ===== */
.video-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.video-cost-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.video-cost-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
}

/* ===== VIDEO GENERATE BUTTON ===== */
.video-generate-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.video-generate-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.video-generate-btn:active {
  transform: scale(0.98);
}

.video-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.video-generate-btn.loading {
  pointer-events: none;
}

/* ===== VIDEO PROGRESS ===== */
.video-generate-progress {
  display: none;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 16px;
  border: 1px solid rgba(106, 106, 255, 0.2);
  text-align: center;
}

.video-generate-progress .progress-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}

.video-generate-progress .progress-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.video-generate-progress .progress-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.video-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
  border-radius: 6px;
  transition: width 0.4s linear;
  box-shadow: 0 0 8px rgba(108, 92, 231, 0.6);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== VIDEO RESULT ===== */
.video-result-area {
  display: none;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.video-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.video-result-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.video-result-close:hover {
  color: var(--text-primary);
}

#videoResultPlayer {
  width: 100%;
  max-height: 400px;
  border-radius: 12px;
  background: black;
  cursor: pointer;
}

.video-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.video-result-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.video-download-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.video-download-btn:hover {
  opacity: 0.9;
}
