/* ========================================
   MentorBoxAI - Vibrant Teal Theme
   Fresh, modern, unique design
   ======================================== */

:root {
  /* Teal/Emerald Color Palette */
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --accent: #f59e0b;
  --accent-dark: #d97706;

  /* Light Theme */
  --bg-main: #f0fdfa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdfa;
  --bg-input: #f0fdfa;

  --text-primary: #134e4a;
  --text-secondary: #115e59;
  --text-muted: #5eead4;

  --border: #99f6e4;
  --border-focus: #0d9488;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-bg: linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(13, 148, 136, 0.1);
  --shadow-md: 0 4px 12px rgba(13, 148, 136, 0.15);
  --shadow-lg: 0 10px 30px rgba(13, 148, 136, 0.2);
  --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.3);

  /* Spacing */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ========================================
   Base Styles
   ======================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ========================================
   Header
   ======================================== */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
}

.logo-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-text .accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: white;
  padding: 8px 16px;
  border-radius: 25px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   Generator Card
   ======================================== */

.generator-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 36px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 15px;
}

/* ========================================
   Form Styles
   ======================================== */

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
  background: white;
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 16px 14px;
  }

  .generator-card {
    padding: 24px 18px;
  }
}

/* Range Input */
.range-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.range-wrapper input[type="range"] {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-value {
  min-width: 45px;
  text-align: right;
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
}

/* Checkbox */
.checkbox-group {
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* ========================================
   Buttons
   ======================================== */

.btn-generate {
  width: 100%;
  padding: 16px 28px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  margin-top: 12px;
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-generate:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   Jobs Section
   ======================================== */

.jobs-section {
  margin-top: 36px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-state {
  text-align: center;
  padding: 50px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 3px dashed var(--border);
}

.empty-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Job Card */
.job-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.job-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.job-card.done {
  cursor: pointer;
  border-left: 4px solid var(--success);
}

.job-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-watch-video {
  padding: 8px 14px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.btn-watch-video:hover {
  background: var(--primary-dark, #5a4fcf);
  transform: scale(1.04);
}

.btn-download-video {
  padding: 8px 14px;
  background: transparent;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

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

.no-video-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.btn-view-plan {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-view-plan:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: white;
}

.job-icon {
  font-size: 28px;
  width: 44px;
  text-align: center;
}

.job-info {
  flex: 1;
}

.job-concept {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 16px;
}

.job-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.job-status {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.job-status.done {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

.job-status.processing,
.job-status.rendering {
  background: rgba(13, 148, 136, 0.2);
  color: var(--primary-dark);
}

.job-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

/* Progress bar */
.job-progress {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.job-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.4s ease;
}

/* ========================================
   Modal
   ======================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 148, 136, 0.3);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 750px;
  width: 100%;
  position: relative;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  max-width: 920px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#modalTitle {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-right: 40px;
  color: var(--text-primary);
}

#videoPlayer {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #134e4a;
}

.modal-actions {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.btn-download,
.btn-regenerate {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download {
  background: var(--gradient-accent);
  color: white;
  border: none;
}

.btn-regenerate {
  background: white;
  border: 2px solid var(--border);
  color: var(--text-secondary);
}

/* Speaker Notes Panel */
.speaker-notes-panel {
  margin-top: 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-height: 220px;
  overflow-y: auto;
}

.notes-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  align-items: flex-start;
}

.note-scene {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  min-width: 80px;
  flex-shrink: 0;
  font-size: 12px;
}

.note-text {
  color: var(--text-primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.tab {
  padding: 10px 18px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.tab:hover {
  border-color: var(--primary);
}

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

/* Code block */
.code-block {
  background: #134e4a;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #ccfbf1;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  text-align: center;
  padding: 36px 18px;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer .heart {
  color: var(--accent);
}

.footer-sub {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   Animations
   ======================================== */

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading .btn-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

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

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}