:root {
  --bg-main: #090c13;
  --bg-card: #121824;
  --bg-card-subtle: #172030;
  --bg-input: #0e131d;
  --border-color: #222d42;
  --border-focus: #3b82f6;
  
  --primary: #ff003b;
  --primary-hover: #e60034;
  --primary-glow: rgba(255, 0, 59, 0.35);
  
  --secondary: #8b5cf6;
  --accent-yellow: #facc15;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(18, 24, 36, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #ff003b, #ff4d6d);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(120deg, #ff3366, #ff758c, #facc15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 0, 59, 0.15);
  color: #ff4d6d;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255, 0, 59, 0.3);
}

.badge-format {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-916 {
  background: rgba(255, 0, 59, 0.2);
  color: #ff4d6d;
  border: 1px solid rgba(255, 0, 59, 0.4);
}
.badge-169 {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.live-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-main);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: white;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Studio Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  align-items: start;
}

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

/* FORMAT & DURATION SELECTOR */
.format-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.section-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.format-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.format-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.format-pill:hover {
  border-color: #4b5563;
  background: rgba(255, 255, 255, 0.05);
}

.format-pill.active {
  border-color: #ff003b;
  background: rgba(255, 0, 59, 0.08);
  box-shadow: 0 0 16px rgba(255, 0, 59, 0.15);
}

.pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff4d6d;
}

.format-pill.active .pill-icon {
  background: #ff003b;
  color: white;
}

.pill-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.pill-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Duration row */
.duration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.duration-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.duration-chips {
  display: flex;
  gap: 6px;
}

.duration-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.duration-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.duration-chip.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Mode Switcher */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-main);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 400;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action input {
  padding-right: 40px;
}

.btn-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.btn-clear:hover {
  color: var(--text-main);
}

/* Suggestion Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}

.chip-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-main);
  border-color: var(--text-dim);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.category-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-subtle);
}

.category-card.active {
  border-color: #ff003b;
  background: rgba(255, 0, 59, 0.08);
  box-shadow: 0 0 16px rgba(255, 0, 59, 0.15);
}

.cat-icon {
  color: #ff4d6d;
  margin-bottom: 6px;
}

.cat-name {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Form Row */
.form-row {
  display: flex;
  gap: 14px;
}

.flex-1 { flex: 1; }
.w-30 { width: 35%; }

/* Voice & Music Selector Rows */
.voice-row, .music-row {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Accordion */
.settings-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  margin-bottom: 24px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--bg-card-subtle);
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.accordion-content {
  padding: 16px;
  display: block;
}

/* Scenes Editor */
.scenes-editor-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.scenes-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.scenes-editor-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scenes-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.scene-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.scene-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
}

.scene-text-input {
  margin-bottom: 8px;
}

.scene-prompt-input {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Action Bar */
.action-bar {
  display: flex;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #ff003b, #ff2a55);
  color: white;
  flex: 2;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e60034, #ff003b);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 0, 59, 0.5);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  flex: 1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
}

.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 59, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(255, 0, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 59, 0); }
}

/* RIGHT PANEL: Player */
.player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ADAPTIVE MOCKUP FRAME */
.mockup-frame {
  position: relative;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

/* Phone Mode (Vertical 9:16) */
.mockup-frame.phone-mode {
  width: 330px;
  height: 586px; /* Exactly 9:16 */
  border-radius: var(--radius-xl);
  border: 8px solid #202736;
}

/* Widescreen Mode (Horizontal 16:9) */
.mockup-frame.widescreen-mode {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 220px;
  border-radius: var(--radius-md);
  border: 6px solid #202736;
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 18px;
  background: #202736;
  border-radius: 12px;
  z-index: 10;
}

.mockup-frame.widescreen-mode .phone-notch {
  display: none;
}

.shorts-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #090d14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shorts-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-placeholder {
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 0, 59, 0.1);
  color: #ff4d6d;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.player-placeholder h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.player-placeholder p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Shorts UI Overlay (only for 9:16 phone mockup) */
.shorts-ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.2) 100%);
}

.mockup-frame.widescreen-mode .shorts-ui-overlay {
  display: none !important;
}

.shorts-side-actions {
  position: absolute;
  right: 12px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.side-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  font-size: 0.7rem;
  gap: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.side-action-btn i {
  width: 24px;
  height: 24px;
}

.shorts-bottom-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 80%;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff003b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

.channel-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.btn-sub {
  background: white;
  color: black;
  border: none;
  border-radius: 14px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.shorts-title-overlay {
  font-size: 0.82rem;
  color: #f1f5f9;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Video Details & Meta Box */
.video-meta-box {
  width: 100%;
}

.download-action {
  margin-bottom: 16px;
}

.meta-field {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}

.meta-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #38bdf8;
}

.meta-field-content {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}

.tags-highlight {
  color: #38bdf8;
  font-weight: 500;
}

/* Modal Progress */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 13, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #141b29;
  border: 1px solid #28354d;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-header p {
  font-size: 0.88rem;
  color: #38bdf8;
  margin-top: 2px;
}

.spinner-ring {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 0, 59, 0.2);
  border-top-color: #ff003b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: #0b1019;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff003b, #facc15);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-percentage {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.progress-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.step-item.active {
  color: #ff4d6d;
  background: rgba(255, 0, 59, 0.08);
  font-weight: 600;
}

.step-item.completed {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* Gallery Tab */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.gallery-video-thumb.is-vertical {
  aspect-ratio: 9/16;
  max-height: 280px;
}

.gallery-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 0, 59, 0.85);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.gallery-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.gallery-actions button,
.gallery-actions a {
  flex: 1;
  padding: 8px;
  font-size: 0.78rem;
}

/* Voices Grid */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.voice-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voice-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.voice-info span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Settings Form */
.settings-card {
  max-width: 720px;
  margin: 0 auto;
}

.section-divider {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: #38bdf8;
}

.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================================================
   MOTOR DE PELÍCULAS IA & DOCUMENTALES 3D (Blogpocket / Barberá UI)
   ============================================================================ */
.movie-engine-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.badge-engine {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.visual-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .visual-style-grid {
    grid-template-columns: 1fr;
  }
}

.style-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: var(--bg-card-subtle);
}

.style-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.18);
}

.style-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.style-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.style-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.scenes-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-copy-pack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-pack:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

.btn-copy-pack svg {
  width: 14px;
  height: 14px;
}

.visual-bible-box {
  margin-bottom: 14px;
}

.bible-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 8px;
}

.bible-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

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

.bible-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
}

.bible-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.bible-code {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-char {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-loc {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.bible-name {
  font-size: 0.78rem;
  color: #f1f5f9;
}

.bible-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bible-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-mini-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-mini-copy:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

.btn-mini-copy svg {
  width: 12px;
  height: 12px;
}

.scene-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.scene-num {
  font-weight: 800;
  color: #f8fafc;
}

.timecode-tag,
.words-tag {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #94a3b8;
}

.ref-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  padding: 1px 6px;
  border-radius: 4px;
}

.scene-cam-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 5px;
}

.scene-sub-label {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  margin: 4px 0 3px;
}

.scene-omni-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.scene-omni-input {
  flex: 1;
  font-size: 0.74rem;
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.6);
}

/* =========================================================
   AUTO-PILOT BANNER & FESTIVALS DIRECTORY
   ========================================================= */
.auto-pilot-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auto-pilot-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.auto-pilot-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.auto-pilot-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.festival-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.festivals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 18px;
}

.festival-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.festival-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
}

.festival-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.festival-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 3px;
}

.festival-org {
  font-size: 0.78rem;
  color: #94a3b8;
}

.festival-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fest-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}

.fest-badge-free {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.fest-badge-paid {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.fest-badge-ai {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.festival-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.fest-row strong {
  color: #e2e8f0;
}

.fest-tip {
  background: rgba(245, 158, 11, 0.09);
  border-left: 3px solid #f59e0b;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.77rem;
  color: #fde68a;
}

.festival-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.presskit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

/* =========================================================
   MOBILE-FIRST & FULL RESPONSIVE SYSTEM (iOS / Android / Tablet / Desktop)
   ========================================================= */
.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
  flex-shrink: 0;
}

.btn-mobile-install {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-mobile-install svg {
  width: 15px;
  height: 15px;
}

/* Tablet & Mobile Navigation + Layout (<= 900px) */
@media (max-width: 900px) {
  .app-container {
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .header {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
  }

  .header-brand {
    width: 100%;
    gap: 10px;
  }

  .brand-text h1 {
    font-size: 1.15rem;
  }

  .badge {
    font-size: 0.65rem;
    padding: 2px 7px;
  }

  .btn-mobile-install {
    display: inline-flex;
  }

  .nav-btn-install-desktop {
    display: none !important;
  }

  /* Native App Fixed Bottom Navigation Bar on Mobile */
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(11, 15, 27, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
  }

  .nav-btn {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-btn svg {
    width: 19px;
    height: 19px;
  }

  .nav-btn.active {
    background: rgba(255, 0, 59, 0.15);
    color: #ff4d6d;
    border: 1px solid rgba(255, 0, 59, 0.35);
    box-shadow: none;
  }

  .card {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-header,
  .panel-header,
  .scenes-editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .scenes-header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  /* Prevent iOS Safari zoom on input focus */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
    padding: 11px 12px;
  }

  .format-card {
    padding: 12px;
  }

  .format-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .format-pill {
    padding: 10px 12px;
  }

  .duration-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .duration-chips {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .duration-chip {
    text-align: center;
    padding: 7px 4px;
    font-size: 0.72rem;
  }

  .auto-pilot-banner {
    padding: 12px;
  }

  .auto-pilot-actions {
    flex-direction: column;
    width: 100%;
  }

  .auto-pilot-actions .btn {
    width: 100%;
  }

  .chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .chip-group .chip,
  .chip-group .chip-label {
    flex-shrink: 0;
  }

  .form-group label {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .w-30 {
    width: 100%;
  }

  .action-bar {
    flex-direction: column;
    gap: 10px;
  }

  .action-bar .btn {
    width: 100%;
    padding: 14px 16px;
  }

  .scene-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .scene-header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .scene-cam-select {
    flex: 1;
  }

  /* Responsive Player Mockup on Mobile */
  .mockup-frame.phone-mode {
    width: min(100%, 310px);
    height: auto;
    aspect-ratio: 9 / 16;
    border-width: 6px;
  }

  .mockup-frame.widescreen-mode {
    border-width: 3px;
    min-height: 180px;
  }

  .download-action {
    flex-direction: column;
  }

  .download-action .btn {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  /* Festival Cards on Mobile */
  .festival-card {
    padding: 14px;
  }

  .festival-card-top {
    flex-direction: column;
    gap: 8px;
  }

  .festival-card-actions {
    flex-direction: column;
  }

  .festival-card-actions .btn,
  .festival-card-actions a {
    width: 100%;
  }

  .festival-filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .festival-filters .chip {
    flex-shrink: 0;
  }

  .voices-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 20px 16px;
    width: 94%;
  }
}


