/**
 * ESTILOS DO EDITOR DE LEGENDAS
 */

.captions-editor {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.editor-header {
  padding: 1rem;
  background: transparent;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-header h2 {
  margin: 0;
  font-size: 24px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: var(--warning);
  color: var(--text-primary);
}

.btn-warning:hover {
  background: #d97706;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.editor-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 0;
}

.preview-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
}

#preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.timeline-controls {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.timeline-slider {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.timeline-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.timeline-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
}

.editor-panel {
  width: 100%;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.tab-content {
  display: none;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

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

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-range {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.form-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.inline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-controls .form-control {
  flex: 0 0 auto;
  width: 80px;
}

.inline-controls .form-range {
  flex: 1;
}

.sub-options {
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.preset-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.preset-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.preset-card p {
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.preset-card .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.presets-section {
  margin-bottom: 2rem;
}

.presets-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: var(--text-primary);
}

/* Scrollbar customizada */
.editor-panel::-webkit-scrollbar {
  width: 8px;
}

.editor-panel::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.editor-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.editor-panel::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Estilos para lista de legendas */
.captions-list {
  max-height: 400px;
  overflow-y: auto;
}

.caption-item {
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.caption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.caption-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.caption-text {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: vertical;
  min-height: 60px;
}

.caption-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.caption-controls input {
  flex: 1;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.btn-remove-caption {
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-caption:hover {
  background: #dc2626;
}
