.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.auth-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 440px;
    text-align: center;
    box-shadow: var(--shadow);
}

.auth-brand { margin-bottom: 2rem; }

.auth-brand h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-drive-login {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    text-decoration: none;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-drive-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.auth-divider {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.auth-footnote {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0;
}

.auth-footnote a {
    color: var(--accent-light);
}

/* Login form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    color: #e85d5d;
    font-size: 0.85rem;
    text-align: center;
}

.auth-form .btn-primary {
    margin-top: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: color 0.2s;
}
.btn-link:hover { color: var(--accent-light); }

.editor-home { min-height: 100vh; background: var(--bg-primary); }
.editor-home-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.editor-home-header h1 { font-size: 1.3rem; }
.header-right { display: flex; gap: 0.75rem; align-items: center; }
.plan-badge { font-size: 0.8rem; color: var(--text-muted); background: var(--bg-hover); padding: 0.3rem 0.75rem; border-radius: 20px; border: 1px solid var(--border); }
.editor-home-content { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.editor-empty { text-align: center; padding: 4rem 2rem; }
.editor-empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.editor-empty h3 { color: var(--text-primary); margin-bottom: 0.5rem; }
.editor-empty p { color: var(--text-muted); margin-bottom: 1.5rem; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }

.project-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.project-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow); }

.project-preview {
    height: 130px; background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem; border-bottom: 1px solid var(--border);
}
.project-duration { background: rgba(0,0,0,0.6); color: white; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; }
.project-clips { background: rgba(196,30,58,0.6); color: white; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; }
.project-title { padding: 0.75rem 1rem 0.25rem; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta { padding: 0 1rem 0.75rem; font-size: 0.8rem; color: var(--text-muted); }
.project-delete {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: rgba(0,0,0,0.5); border: none; color: white; font-size: 0.9rem;
    cursor: pointer; opacity: 0; border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center; transition: opacity 0.2s;
}
.project-card:hover .project-delete { opacity: 1; }
.project-delete:hover { background: var(--accent-primary); }

.video-editor { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-primary); }

.ve-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 1rem; flex: 1; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.btn-back { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; cursor: pointer; }
.btn-back:hover { color: var(--accent-light); }
.title-input { background: transparent; border: none; color: var(--text-primary); font-size: 1rem; font-weight: 600; font-family: var(--font); outline: none; max-width: 250px; }
.title-input:focus { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 0.2rem 0.4rem; }
.save-status { font-size: 0.8rem; color: var(--text-muted); }
.watermark-badge { font-size: 0.75rem; background: rgba(196,30,58,0.2); color: var(--accent-light); padding: 0.2rem 0.6rem; border-radius: 12px; }

.ve-layout { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.ve-sidebar {
    width: 280px; background: var(--bg-secondary); border-right: 1px solid var(--border);
    overflow-y: auto; display: flex; flex-direction: column;
}

.panel-section { padding: 1rem; border-bottom: 1px solid var(--border); }
.panel-section h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.btn-add-clip {
    width: 100%; padding: 0.5rem; background: var(--bg-hover); border: 1px dashed var(--border);
    color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem;
    margin-bottom: 0.75rem; transition: all 0.2s;
}
.btn-add-clip:hover { border-color: var(--accent-light); color: var(--accent-light); }

.clips-list, .overlays-list { display: flex; flex-direction: column; gap: 0.5rem; }

.clip-item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem;
    background: var(--bg-hover); border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s;
}
.clip-item.active { border-color: var(--accent-primary); }
.clip-name { flex: 1; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-dur { font-size: 0.75rem; color: var(--text-muted); }
.clip-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; }
.clip-delete:hover { color: var(--accent-light); }

.overlay-item {
    background: var(--bg-hover); border-radius: var(--radius-sm); padding: 0.5rem;
}
.overlay-text-input {
    width: 100%; padding: 0.3rem; background: var(--bg-primary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 4px; font-size: 0.85rem; margin-bottom: 0.4rem;
}
.overlay-controls { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; }
.overlay-controls input[type="color"] { width: 24px; height: 24px; border: none; cursor: pointer; }
.overlay-controls input[type="number"] { background: var(--bg-primary); border: 1px solid var(--border); color: var(--text-primary); border-radius: 4px; padding: 0.2rem; font-size: 0.8rem; }
.bold-toggle { display: flex; align-items: center; gap: 2px; cursor: pointer; font-size: 0.8rem; color: var(--text-secondary); }
.overlay-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; margin-left: auto; }
.overlay-delete:hover { color: var(--accent-light); }
.overlay-position { display: flex; flex-direction: column; gap: 0.2rem; }
.overlay-position label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--text-muted); }
.overlay-position input[type="range"] { flex: 1; height: 3px; }

.plan-info { font-size: 0.85rem; }
.plan-detail { color: var(--text-secondary); margin-bottom: 0.3rem; font-size: 0.8rem; }

/* Preview */
.ve-preview { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }

.preview-container {
    width: 100%; max-width: 960px; aspect-ratio: 16/9;
    background: #000; border-radius: var(--radius); position: relative; overflow: hidden;
}

.preview-overlay {
    position: absolute; pointer-events: none; text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-family: var(--font); white-space: nowrap;
}

.watermark-preview {
    position: absolute; bottom: 16px; right: 16px;
    color: rgba(255,255,255,0.5); font-size: 14px; font-weight: bold;
    font-family: var(--font); text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.no-clip { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); }

/* Timeline */
.ve-timeline {
    height: 80px; background: var(--bg-secondary); border-top: 1px solid var(--border);
    padding: 0.75rem 1rem; flex-shrink: 0;
}

.timeline-track {
    display: flex; gap: 4px; height: 100%; align-items: stretch;
}

.timeline-clip {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-soft));
    border-radius: 6px; padding: 0.5rem; display: flex; flex-direction: column;
    justify-content: center; cursor: pointer; transition: all 0.2s;
    border: 2px solid transparent; min-width: 80px;
}
.timeline-clip.active { border-color: var(--accent-light); }
.timeline-clip:hover { opacity: 0.9; }
.tc-name { font-size: 0.7rem; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-dur { font-size: 0.65rem; color: rgba(255,255,255,0.7); }

.timeline-empty {
    flex: 1; display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--border); border-radius: 6px; color: var(--text-muted); font-size: 0.85rem;
}

:root {
  /* Atlas Editor — Purple accent */
  --bg-primary: #0f0f0f;
  --bg-secondary: #181518;
  --bg-card: #211a22;
  --bg-hover: #2a202a;
  --accent-primary: #8b5cf6;
  --accent-soft: #7c3aed;
  --accent-dark: #6d28d9;
  --accent-muted: #5b21b6;
  --accent-light: #a78bfa;
  --text-primary: #f0e6f5;
  --text-secondary: #b8a8c4;
  --text-muted: #80708a;
  --border: #352a3d;
  --success: #2d8a5e;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --font: 'DM Sans', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent-light); }
button { font-family: var(--font); cursor: pointer; }
input, textarea { font-family: var(--font); }
#root { min-height: 100vh; }

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; color: var(--text-secondary); font-size: 1.1rem;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-soft));
  color: white; border: none; padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-hover); color: var(--text-primary);
  border: 1px solid var(--border); padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm); font-weight: 500; font-size: 0.9rem; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--text-muted); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-card {
  background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--border); width: 90%; max-width: 420px;
}
.modal-card h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.modal-card input {
  width: 100%; padding: 0.6rem; border-radius: var(--radius-sm);
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.95rem; margin-bottom: 1rem;
}
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

