/* ==========================================================================
   SAKAI VIDEO STUDIO | LUXURY VIP DARK DESIGN SYSTEM
   Mobile-First • Anti-Overflow • Simetria Executiva
   ========================================================================== */

:root {
  --bg-deep: #07080b;
  --bg-card: #0d1017;
  --bg-surface: #141822;
  --bg-surface-elevated: #1b212f;
  
  --gold-primary: #d4af37;
  --gold-light: #f3cf65;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-border: rgba(212, 175, 55, 0.22);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.18);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Grotesk', monospace;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Header Executivo Mobile-First
   -------------------------------------------------------------------------- */
.studio-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  width: 100%;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  flex-shrink: 0;
}

.brand-icon {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  opacity: 0.85;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 5px 10px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-text {
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

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

.btn-refresh svg {
  width: 16px;
  height: 16px;
}

.btn-refresh:hover {
  color: var(--text-main);
  border-color: var(--gold-border);
}

/* --------------------------------------------------------------------------
   Layout e Estrutura Principal
   -------------------------------------------------------------------------- */
.studio-main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 12px 60px 12px;
}

.studio-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Seletor de Modo Operacional
   -------------------------------------------------------------------------- */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(13, 16, 23, 0.95));
  border-color: var(--gold-primary);
  color: var(--text-main);
  box-shadow: 0 4px 18px var(--gold-glow);
}

.mode-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mode-btn.active .mode-icon {
  color: var(--gold-light);
}

.mode-info {
  display: flex;
  flex-direction: column;
}

.mode-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.mode-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Card de Composicao / Formulario
   -------------------------------------------------------------------------- */
.composer-card, .plan-card, .player-card, .history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  box-shadow: var(--shadow-subtle);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

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

.card-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-border);
  padding: 4px 9px;
  border-radius: var(--radius-full);
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-textarea, .form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
  line-height: 1.5;
}

.form-textarea:focus, .form-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* Dropzone de Upload */
.upload-dropzone {
  border: 1px dashed var(--gold-border);
  background: rgba(212, 175, 55, 0.03);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover {
  background: rgba(212, 175, 55, 0.07);
  border-color: var(--gold-light);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-icon {
  width: 24px;
  height: 24px;
  color: var(--gold-light);
}

.upload-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.upload-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.uploaded-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.uploaded-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-main);
}

/* Botoes de Selecao de Proporcao e Duracao */
.ratio-selector, .duration-selector {
  display: flex;
  gap: 6px;
}

.ratio-btn, .duration-btn {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 9px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ratio-btn.active, .duration-btn.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* Botoes de Acao Principal */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #d4af37, #b89728);
  color: #07080b;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--gold-glow);
  transition: all 0.25s ease;
  margin-top: 8px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

.btn-icon {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Card de Plano Cinematografico
   -------------------------------------------------------------------------- */
.plan-card {
  margin-top: 20px;
  border-color: var(--gold-border);
  background: linear-gradient(180deg, rgba(20, 24, 34, 0.8), rgba(13, 16, 23, 0.95));
}

.plan-header-title {
  display: flex;
  flex-direction: column;
}

.plan-meta {
  font-size: 0.7rem;
  color: var(--gold-light);
  font-weight: 600;
}

.btn-approve {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-green);
  color: #052e16;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-approve:hover {
  filter: brightness(1.1);
}

.plan-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.timeline-block {
  background: var(--bg-surface);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 14px;
}

.block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.block-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

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

.block-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

.block-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 0.68rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.audio-tag {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.voice-tag {
  color: var(--accent-purple);
  border-color: rgba(168, 85, 247, 0.3);
}

.brand-tag {
  color: var(--gold-light);
  border-color: var(--gold-border);
}

/* Model Sheet */
.model-sheet-container {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: 14px;
}

.model-sheet-title {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 10px;
}

.angles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.angle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.angle-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
}

.angle-detail {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Painel de Visualizacao e Player
   -------------------------------------------------------------------------- */
.player-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.player-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.resolution-badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.video-container {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  position: relative;
  aspect-ratio: 9/16;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-subtle);
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay-watermark {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.player-footer {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-details {
  display: flex;
  flex-direction: column;
}

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

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

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-download svg {
  width: 16px;
  height: 16px;
}

.btn-download:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-light);
}

/* --------------------------------------------------------------------------
   Historico de Projetos
   -------------------------------------------------------------------------- */
.history-card {
  margin-top: 20px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.history-count {
  font-size: 0.7rem;
  color: var(--text-dim);
}

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

.empty-state {
  text-align: center;
  padding: 24px 10px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--gold-border);
}

.item-info {
  display: flex;
  flex-direction: column;
}

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

.item-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

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

.btn-mini:hover {
  color: var(--gold-light);
  border-color: var(--gold-border);
}

/* --------------------------------------------------------------------------
   Desktop & Telas Maiores (Min-width: 960px)
   -------------------------------------------------------------------------- */
@media (min-width: 960px) {
  .studio-main {
    padding: 28px 24px 80px 24px;
  }

  .studio-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: start;
  }

  .form-row {
    flex-direction: row;
  }

  .angles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .video-container {
    max-width: 320px;
  }
}
