:root {
  --bg-primary: #0a0a16;
  --bg-secondary: rgba(20, 20, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-color: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --success-color: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding: 2rem;
}

/* Glassmorphism Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.config-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.config-bar input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.9rem;
  width: 280px;
  outline: none;
  transition: all 0.3s;
}

.config-bar input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

input[type="text"], textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
  width: 100%;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  text-align: center;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--accent-glow);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
  box-shadow: 0 5px 15px var(--success-glow);
}

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

/* Script Editor */
.editor-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-textarea {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  min-height: 300px;
  background: rgba(0, 0, 0, 0.4);
}

/* Logs and Terminal Panel */
.terminal {
  background: #050510;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 250px;
  overflow-y: auto;
  padding: 1rem;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scroll-behavior: smooth;
}

.log-line {
  color: #a7f3d0;
  line-height: 1.4;
}

.log-line.system {
  color: #3b82f6;
  font-weight: bold;
}

.log-line.error {
  color: #ef4444;
  font-weight: bold;
}

.log-line.success {
  color: #10b981;
  font-weight: bold;
}

/* Video Preview */
.video-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: black;
  aspect-ratio: 16/9;
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color) 0%, #10b981 100%);
  width: 0%;
  transition: width 0.4s ease;
}
