/* === Variables === */
:root {
    /* Colors - Dark cyberpunk theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-hover: #22222f;
    
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    
    --accent-primary: #00ff88;
    --accent-secondary: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    
    --danger: #ff4466;
    --danger-glow: rgba(255, 68, 102, 0.15);
    
    --warning: #ffaa00;
    --info: #00aaff;
    
    --border: #2a2a3a;
    --border-focus: #00ff88;
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --sidebar-width: 240px;
    --header-height: 72px;
    
    /* Effects */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 30px var(--accent-glow);
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, var(--accent-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 170, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* === Layout === */
.app {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    font-size: 28px;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

/* === Main Content === */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.content {
    padding: 32px;
}

/* === Sections === */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-approve {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 14px 32px;
    font-size: 16px;
}

.btn-approve:hover {
    background: var(--accent-secondary);
}

.btn-reject {
    background: var(--danger);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
}

.btn-reject:hover {
    background: #dd3355;
}

/* === Cards === */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* === Highlight Cards === */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.highlight-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.highlight-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.highlight-thumbnail {
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.highlight-thumbnail::after {
    content: '▶';
    font-size: 32px;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.highlight-info {
    padding: 16px;
}

.highlight-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.highlight-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* === Filter Bar === */
.filter-bar {
    margin-bottom: 24px;
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* === Prompts === */
.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
}

.prompt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.prompt-card.default {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-glow) 0%, var(--bg-secondary) 100%);
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.prompt-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-preview {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.prompt-actions {
    display: flex;
    gap: 8px;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-large {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* === Forms === */
.form-group {
    padding: 0 24px;
    margin: 20px 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* === Review Modal === */
.review-content {
    padding: 24px;
}

.video-container {
    aspect-ratio: 16/9;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.review-info {
    padding: 0;
}

.review-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.timestamp {
    color: var(--accent-primary);
}

.confidence {
    color: var(--text-secondary);
}

.review-actions {
    justify-content: center;
    gap: 24px;
}

/* === Clips Grid === */
.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.clip-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.clip-thumbnail {
    aspect-ratio: 9/16;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 320px;
}

.clip-info {
    padding: 16px;
}

.clip-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.clip-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === Status Badges === */
.status-pending {
    color: var(--warning);
}

.status-approved {
    color: var(--accent-primary);
}

.status-rejected {
    color: var(--danger);
}

.status-published {
    color: var(--info);
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section.active {
    animation: fadeIn 0.3s ease;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === Auth Screen === */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-logo .logo-icon {
    font-size: 36px;
    color: var(--accent-primary);
    text-shadow: 0 0 30px var(--accent-glow);
}

.auth-logo .logo-text {
    font-size: 28px;
    font-weight: 700;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.auth-tab.active {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form .form-group {
    padding: 0;
    margin: 0 0 16px 0;
}

.auth-error {
    color: var(--danger);
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* === Main App Layout === */
.main-app {
    display: flex;
    min-height: 100vh;
}

/* === VODs Grid === */
.vods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.vod-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vod-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.vod-thumbnail {
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vod-thumbnail::after {
    content: '▶';
    font-size: 32px;
    color: var(--text-muted);
}

.vod-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
}

.vod-info {
    padding: 16px;
}

.vod-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.vod-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.vod-status {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Highlight Card Duration === */
.highlight-thumbnail {
    position: relative;
}

.highlight-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
}

/* === Form Row === */
.form-row {
    display: flex;
    gap: 16px;
    padding: 0 24px;
    margin: 20px 0;
}

.form-row .form-group {
    flex: 1;
    padding: 0;
    margin: 0;
}

/* === Textarea === */
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* === User Info === */
.user-info {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* === Small Button === */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* === Clip Duration === */
.clip-duration {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

/* === Status Colors === */
.status-completed {
    color: var(--accent-primary);
}

.status-processing {
    color: var(--info);
}

.status-failed {
    color: var(--danger);
}

/* === Fullscreen Modal === */
.modal-fullscreen {
    max-width: 95vw;
    width: 1400px;
    max-height: 95vh;
}

/* === Highlight Editor === */
.highlight-editor {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-video-container {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 50vh;
}

.editor-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* === Timeline === */
.editor-timeline {
    padding: 0 20px;
}

.timeline-track {
    position: relative;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: visible;
}

.timeline-selection {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--accent-glow);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    min-width: 20px;
}

.timeline-handle {
    position: absolute;
    top: -4px;
    width: 12px;
    height: calc(100% + 8px);
    background: var(--accent-primary);
    cursor: ew-resize;
    border-radius: 4px;
    transition: transform 0.1s ease;
}

.timeline-handle:hover {
    transform: scaleX(1.3);
}

.timeline-handle-start {
    left: -6px;
}

.timeline-handle-end {
    right: -6px;
}

.timeline-playhead {
    position: absolute;
    top: -8px;
    width: 3px;
    height: calc(100% + 16px);
    background: var(--danger);
    pointer-events: none;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--danger-glow);
}

.timeline-times {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-times span:nth-child(2) {
    color: var(--danger);
    font-weight: 600;
}

/* === Editor Controls === */
.editor-controls {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-input {
    width: 60px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    text-align: center;
}

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

.time-input-group span {
    color: var(--text-secondary);
    font-size: 18px;
}

/* === Editor Form === */
.editor-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.editor-form .form-group {
    padding: 0;
    margin: 0;
}

/* === Clip Preview Info === */
.clip-preview-info {
    padding: 16px 0;
    color: var(--text-secondary);
}

.clip-preview-info p {
    margin-bottom: 8px;
}

.clip-preview-info strong {
    color: var(--text-primary);
}

/* === VOD Card Clickable === */
.vod-card {
    cursor: pointer;
}

.vod-card:hover .vod-thumbnail::after {
    color: var(--accent-primary);
    transform: scale(1.2);
    transition: all 0.2s ease;
}

/* === Nav Divider === */
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* === Settings Section === */
.settings-container {
    max-width: 600px;
}

.settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.settings-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.settings-icon.tiktok-icon {
    background: linear-gradient(135deg, #00f2ea, #ff0050);
    color: white;
}

.settings-card-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-card-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-card-actions {
    display: flex;
    gap: 12px;
}

.settings-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.settings-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.settings-info p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.settings-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-info ul li {
    color: var(--text-secondary);
    font-size: 14px;
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}

.settings-info ul li::before {
    content: "•";
    color: var(--accent-primary);
    position: absolute;
    left: 0;
}

/* Connected state */
.settings-card.connected {
    border-color: var(--accent-primary);
}

.settings-card.connected .settings-card-info p {
    color: var(--accent-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #ff5577;
}

/* === Responsive === */
@media (max-width: 768px) {
    .editor-form {
        grid-template-columns: 1fr;
    }
    
    .editor-controls {
        flex-direction: column;
    }
    
    .modal-fullscreen {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}

