/* Sim2Real Video Editor - Custom Styles */

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  background: white;
  border-bottom: 2px solid var(--gray-200);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subtitle {
  color: var(--gray-600);
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Steps Progress Bar */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 60%;
  right: -40%;
  height: 2px;
  background: var(--gray-300);
  z-index: 0;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
  background: var(--primary);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-300);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.step.completed .step-number {
  background: var(--success);
}

.step-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

/* Content Sections */
.content-section {
  display: none;
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.section-description {
  color: var(--gray-600);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* Upload Zone */
.upload-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--gray-50);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.upload-zone h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--gray-800);
}

.upload-icon {
  font-size: 3rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.upload-zone p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.btn-upload {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-upload:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

input[type="file"] {
  display: none;
}

/* Video Preview */
.video-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
  display: none;
}

.video-preview.active {
  display: block;
}

.video-preview video {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.video-info {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.video-info div {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

/* Edit Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.setting-group select,
.setting-group input[type="range"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.setting-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setting-group input[type="range"] {
  padding: 0;
}

.range-value {
  display: inline-block;
  margin-left: 1rem;
  font-weight: 600;
  color: var(--primary);
}

/* Progress Section */
.progress-container {
  margin-bottom: 2rem;
}

.progress-bar-wrapper {
  background: var(--gray-200);
  height: 30px;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  width: 0%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.status-badge.pending {
  background: var(--gray-200);
  color: var(--gray-700);
}

.status-badge.processing {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  animation: pulse 2s infinite;
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

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

.logs-container {
  background: var(--gray-900);
  color: #00ff00;
  padding: 1.5rem;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 1rem;
}

.logs-container .log-entry {
  margin-bottom: 0.25rem;
}

.logs-container .log-entry .timestamp {
  color: #888;
  margin-right: 0.5rem;
}

/* Results Section */
.result-video {
  background: var(--gray-900);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.result-video video {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.875rem 2rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
  border-color: var(--gray-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Action Buttons */
.actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Notification */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error {
  border-left: 4px solid var(--error);
}

.notification.warning {
  border-left: 4px solid var(--warning);
}

.notification-icon {
  font-size: 1.5rem;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .upload-container {
    grid-template-columns: 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-tab {
  flex: 1;
  padding: 1rem 2rem;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  background: white;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.nav-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Cost Estimator */
.cost-estimator {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.cost-estimator h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-800);
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.cost-item label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.cost-item select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
}

.cost-result {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.cost-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
}

.cost-row span:first-child {
  color: var(--gray-600);
  font-weight: 500;
}

.cost-row span:last-child {
  font-weight: 700;
  font-size: 1.25rem;
}

/* Training Settings */
.training-settings {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.training-settings h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-800);
}

.text-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.text-input {
  resize: vertical;
  font-family: inherit;
}

/* Training Progress */
.training-progress {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-top: 2rem;
}

.training-progress h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-800);
}

.training-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
}

.stat-item span:first-child {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.stat-item span:last-child {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.model-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.model-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.model-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--gray-800);
}

.model-card p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.model-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.model-meta div {
  display: flex;
  justify-content: space-between;
}

.model-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.loading-spinner {
  text-align: center;
  padding: 3rem;
  color: var(--gray-600);
  font-size: 1.25rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-gray { color: var(--gray-600); }

/* Analysis Results Styles */
.analysis-summary {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  border: 1px solid var(--gray-300);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.analysis-card {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  text-align: center;
}

.analysis-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.analysis-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
}

#text-color-box {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
