/* ==========================================================================
   Dashboard, in the studio system: drop a photo, bring it to life
   ========================================================================== */

body.menu-open { overflow: hidden; }

.dashboard-main { padding: 20px 0 60px; }

.dashboard-container { width: min(100% - 40px, 1280px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }

.dashboard-title { grid-column: 1 / -1; font: 400 clamp(34px, 5vw, 48px) / 1.02 var(--font-display); letter-spacing: -.025em; margin: 12px 0 4px; }

.dashboard-left { display: flex; flex-direction: column; gap: 20px; }

.dashboard-section { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }

/* Upload */
.upload-area { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 380px; padding: 36px 20px; border: 1px dashed var(--line-dash); border-radius: 8px; background: var(--surface); cursor: pointer; transition: background .16s, border-color .16s; }
.upload-area:hover, .upload-area.drag-over { background: var(--accent-wash); border-color: var(--ink); }
.upload-icon { width: 64px; height: 64px; margin-bottom: 16px; color: var(--ink); }
.upload-icon svg { width: 100%; height: 100%; }
.upload-title { font: 400 32px/1.05 var(--font-display); letter-spacing: -.02em; margin-bottom: 6px; }
.upload-info { color: var(--muted); font-size: 14px; }
.upload-shortcut { margin-top: 18px; min-height: 48px; display: inline-flex; align-items: center; padding: 10px 18px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--accent); box-shadow: 4px 5px 0 var(--ink); font-weight: 700; font-size: 15px; }

.upload-preview { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; background: var(--surface-raised); border: 1px solid var(--line-soft); padding: 12px 12px 0; transform: rotate(-1deg); box-shadow: 2px 5px 12px #29231c1c; }
.upload-preview img { max-height: 480px; max-width: 100%; object-fit: contain; display: block; margin-bottom: 12px; }
.remove-image { position: absolute; top: -12px; right: -12px; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); font-size: 20px; line-height: 1; }
.remove-image:hover { background: var(--accent); }

/* Finished video */
.video-preview { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; background: var(--surface-raised); border: 1px solid var(--line-soft); padding: 12px 12px 56px; transform: rotate(1deg); box-shadow: 2px 5px 12px #29231c1c; }
.video-preview video { max-height: 480px; max-width: 100%; background: var(--surface-inset); }
.play-btn-overlay { position: absolute; top: calc(50% - 28px); left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); border: 1.5px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transition: opacity .2s; }
.play-btn-overlay.playing { opacity: 0; }
.video-preview:hover .play-btn-overlay.playing { opacity: .95; }
.video-controls { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 10px; }
.sound-toggle, .download-btn-overlay { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--ink); background: var(--paper); }
.sound-toggle:hover, .download-btn-overlay:hover { background: var(--accent); }
.sound-toggle.muted { color: var(--muted); }

/* Options */
.generate-section { display: flex; flex-direction: column; gap: 16px; }
.option-group { padding: 16px; border-radius: 8px; background: #e9eddf; }
.option-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.option-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); border: 1px solid var(--line); }
.option-icon svg { width: 20px; height: 20px; }
.option-title-group { display: flex; flex-direction: column; }
.option-label { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.option-subtitle { font-size: 12px; color: var(--muted); }
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); cursor: pointer; transition: box-shadow .16s, border-color .16s, background .16s; }
.radio-option.checked, .radio-option:has(input:checked) { border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: #f0f3c5; }
.radio-option input[type="radio"] { appearance: none; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; cursor: pointer; }
.radio-option input[type="radio"]:checked::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.option-name { flex-grow: 1; font-weight: 600; font-size: 14px; }
.credit-badge { font: 500 10px/1.5 var(--font-ibm-plex-mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.radio-option.checked .credit-badge { background: var(--accent); border-color: var(--ink); color: var(--ink); }
.credits-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.credits-text { font-weight: 600; }
.credits-link { text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
.btn-generate { width: 100%; min-height: var(--cta-height); font-size: 16px; }
.btn-generate.btn-another { background: var(--surface-raised); }

/* Progress */
.generation-progress { padding: 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.progress-bar-container { width: 100%; height: 10px; border-radius: 999px; background: var(--surface-inset); border: 1px solid var(--line); overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.progress-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-percent { font: 400 22px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.progress-text { font: italic 16px/1.3 var(--font-instrument-serif); }

/* Example reel */
.dashboard-reel-section { position: sticky; top: 108px; display: flex; flex-direction: column; gap: 10px; }
.reel-label { font: italic 20px/1.2 var(--font-instrument-serif); }
.reel-frame { position: relative; background: var(--surface-raised); border: 1px solid var(--line-soft); padding: 9px 9px 0; transform: rotate(2deg); box-shadow: 2px 5px 12px #29231c1c; overflow: hidden; }
.reel-video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 9px; }
.reel-static-overlay { position: absolute; inset: 0; pointer-events: none; background: var(--surface); opacity: 0; transition: opacity .6s ease-out; }
.reel-copy { color: var(--muted); font-size: 13px; }

/* My memories */
.videos-section { grid-column: 1 / -1; }
.section-heading { font: 400 34px/1.05 var(--font-display); letter-spacing: -.02em; margin-bottom: 18px; }
.videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 16px; }
.video-placeholder { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed var(--line-dash); border-radius: 8px; color: var(--muted); font-size: 14px; }
.video-card { background: var(--surface-raised); border: 1px solid var(--line-soft); padding: 8px 8px 10px; box-shadow: 1px 3px 8px #29231c16; }
.video-card-preview { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-inset); }
.video-card-preview video { width: 100%; height: 100%; object-fit: cover; }
.video-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #29231c40; opacity: 0; transition: opacity .2s; }
.video-card-preview:hover .video-overlay { opacity: 1; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); border: 1.5px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); }
.video-card-info { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.video-status { font: 500 10px/1.5 var(--font-ibm-plex-mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); }
.status-complete { background: var(--accent-wash); border-color: var(--ink); }
.status-processing { background: var(--lavender); }
.status-failed { background: #fcebe4; color: var(--error); border-color: #d7a393; }
.video-date { flex-grow: 1; font: 12px var(--font-ibm-plex-mono); color: var(--muted); }
.download-btn, .download-btn-small { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--ink); background: var(--paper); }
.download-btn:hover, .download-btn-small:hover { background: var(--accent); }
.video-loading, .video-failed { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; }
.video-loading { background: var(--surface); }
.loading-text { font: italic 15px/1.3 var(--font-instrument-serif); }
.loading-eta { font: 10px var(--font-ibm-plex-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loading-spinner-large, .loading-spinner { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .9s linear infinite; }
.loading-spinner { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-failed { background: #fcebe4; color: var(--error); }
.video-failed p { color: var(--error); font-size: 13px; }
.btn-view-more { display: block; margin: 24px auto 0; }

/* Full-page drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 900; display: none; align-items: center; justify-content: center; background: #fff8e9f0; pointer-events: none; }
.drop-overlay.active { display: flex; }
.drop-overlay-content { text-align: center; padding: 40px 56px; border: 1.5px dashed var(--ink); border-radius: 8px; background: var(--accent-wash); }
.drop-overlay-icon { width: 64px; height: 64px; color: var(--ink); margin: 0 auto 12px; }
.drop-overlay-text { font: 400 40px/1.05 var(--font-display); letter-spacing: -.02em; }
.drop-overlay-subtext { color: var(--muted); margin-top: 6px; font-size: 14px; }

@media (max-width: 899px) {
  .dashboard-container { grid-template-columns: 1fr; }
  .dashboard-reel-section { position: static; }
  .reel-frame { max-width: 300px; }
  .dashboard-section { padding: 14px; }
  .upload-area { min-height: 300px; padding: 28px 14px; }
  .radio-group { grid-template-columns: 1fr; }
  .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .drop-overlay-content { padding: 28px 20px; margin: 16px; }
}

@media (max-width: 480px) {
  .videos-grid { grid-template-columns: 1fr; }
  .upload-preview, .video-preview { transform: none; }
}
