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

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
  font-family: 'Prompt', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 40px;
}

.header-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

/* Form Section */
.form-section {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-xl);
}

.form-group {
  margin-bottom: 25px;
}

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

.required {
  color: var(--danger-color);
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-primary);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* File Upload */
.file-upload {
  position: relative;
}

input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-upload-label {
  display: block;
  padding: 20px;
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.file-upload-label:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.file-upload-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.image-preview {
  margin-top: 15px;
  text-align: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.info-box p {
  margin: 5px 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-copy {
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 30px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  margin-top: 20px;
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-copy {
  background: var(--success-color);
  color: white;
  margin-top: 15px;
  padding: 10px 20px;
}

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

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Result Section */
.result-section {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease;
}

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

.result-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-card {
  background: var(--bg-secondary);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
}

.result-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.caption-result,
.prompt-result {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.8;
}

.video-result {
  text-align: center;
  padding: 20px;
}

.video-result video {
  max-width: 100%;
  max-height: 600px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.loading-message {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header {
    padding: 30px 15px;
    margin-bottom: 30px;
  }

  .logo {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .form-section,
  .result-section {
    padding: 25px;
    border-radius: 15px;
  }

  .result-title {
    font-size: 1.5rem;
  }

  .result-card h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .form-section,
  .result-section {
    padding: 20px;
  }

  input[type="text"],
  textarea,
  select {
    font-size: 0.95rem;
    padding: 10px 14px;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 0.95rem;
    padding: 12px 24px;
  }
}
