/* Light theme with blue tones */
:root {
  --bg: #fefefe;
  --bg-secondary: #f8fafc;
  --panel: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --good: #10b981;
  --warn: #f59e0b;
  --error: #ef4444;
  --hover: #f8fafc;
  --shadow: rgba(59, 130, 246, 0.05);
  --shadow-medium: rgba(59, 130, 246, 0.1);
  --shadow-strong: rgba(59, 130, 246, 0.15);
}

/* Reset and base styles */
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  min-height: 100vh;
}

/* Top Banner */
.top-banner {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-logo {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

.banner-cta-button {
  appearance: none;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.banner-cta-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.banner-cta-button:active {
  transform: translateY(0);
}

/* Landing Section */
.landing-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fefefe 0%, #f0f9ff 100%);
  padding: 4rem 2rem;
}

.landing-content {
  max-width: 1200px;
  width: 100%;
  text-align: center;
}

.hero-description {
  margin-bottom: 4rem;
}

.main-description {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Videos Section */
.videos-section {
  display: flex;
  justify-content: center;
  margin-bottom: 4rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.main-video {
  width: 100%;
  max-width: 600px;
}

.video-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--shadow-strong);
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
}

/* Manifesto Section */
.manifesto-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.manifesto-item {
  text-align: center;
  padding: 2rem 1rem;
}

.manifesto-item h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

.manifesto-item p {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}


/* App Header */
.app-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--accent-dark);
}

.app-title-small {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-decoration: none;
}

/* API Section */
.api-section {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding: 2rem;
}

/* Adjust API section for app page with header */
.app-header + .api-section {
  min-height: calc(100vh - 80px);
}

.api-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: calc(100vh - 4rem);
}

/* Jobs Section */
.jobs-section {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-direction: column;
}

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

.jobs-header h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
}


.jobs-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

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

/* Main Panel */
.main-panel {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  padding: 2rem;
}

/* Form Elements */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  background: var(--hover);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  text-align: center;
  margin-bottom: 1.5rem;
}

.dropzone:hover, .dropzone:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
  transform: scale(1.01);
}

.dz-content { 
  display: flex; 
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dz-icon { 
  font-size: 3rem;
  opacity: 0.6;
}

.dz-title { 
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
}

.dz-sub { 
  color: var(--text-muted); 
  font-size: 0.875rem;
  font-weight: 300;
}

.filelist { 
  margin-bottom: 1.5rem;
  display: flex; 
  flex-wrap: wrap;
  gap: 0.75rem; 
}

.filechip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow);
  animation: slideIn 0.3s ease-out;
}

.filechip .ext { 
  color: var(--text-light); 
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 500;
}

.controls-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 2rem; 
  align-items: flex-end; 
  margin-bottom: 2rem;
}

.field { 
  display: flex;
  flex-direction: column;
  gap: 0.5rem; 
  flex: 1;
  min-width: 200px;
}

.label { 
  color: var(--text-muted); 
  font-size: 0.875rem;
  font-weight: 500;
}

input[type="file"] {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Switch */
.switch { 
  position: relative; 
  display: inline-flex; 
  align-items: center; 
  gap: 0.75rem; 
  cursor: pointer; 
  user-select: none;
  margin-top: 0.5rem;
}

.switch input { display: none; }

.switch .slider { 
  width: 48px; 
  height: 28px; 
  background: var(--border); 
  border-radius: 14px; 
  position: relative; 
  transition: all 0.2s ease;
}

.switch .slider::after { 
  content: ""; 
  position: absolute; 
  top: 2px; 
  left: 2px; 
  width: 24px; 
  height: 24px; 
  background: white; 
  border-radius: 50%; 
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch input:checked + .slider { 
  background: var(--accent); 
}

.switch input:checked + .slider::after { 
  transform: translateX(20px); 
}

.switch-label { 
  color: var(--text); 
  font-size: 0.875rem;
  font-weight: 500;
}

/* Buttons */
.actions { 
  display: flex; 
  gap: 1rem; 
  justify-content: flex-start;
}

button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 140px;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

button.secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}

button.secondary:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow);
}

button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Job Cards */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.empty-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.job {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--panel);
  box-shadow: 0 1px 3px var(--shadow);
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease-out;
}

.job:hover {
  box-shadow: 0 4px 12px var(--shadow-medium);
  transform: translateY(-1px);
}

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

.job .title {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job .meta { 
  color: var(--text-muted); 
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.statusline { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  margin-bottom: 0.75rem;
}

.dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: var(--warn); 
  display: inline-block;
  position: relative;
}

.dot::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
}

.dot.ok { 
  background: var(--good);
  color: var(--good);
}

.dot.err { 
  background: var(--error);
  color: var(--error);
}

.dot.processing {
  background: var(--accent);
  color: var(--accent);
  animation: pulse 2s infinite;
}

.status {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.links a:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.review-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.review-btn:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.review-btn:not(:disabled):hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Progress Animation for Jobs */
.job.processing .dot::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .api-layout {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .top-banner {
    padding: 1rem;
  }
  
  .banner-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .banner-logo {
    font-size: 2rem;
  }
  
  .banner-cta-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .landing-section {
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
  }
  
  .main-description {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
  
  .api-section {
    padding: 1rem;
  }
  
  .videos-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .manifesto-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .actions {
    flex-direction: column;
  }
  
  button {
    width: 100%;
  }
  
  .job-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .job .title {
    text-align: center;
  }
  
  .review-btn {
    align-self: center;
  }
}

/* Focus states for accessibility */
.video-container:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text);
}