/* Reddit Downloader - Main Styles */

:root {
    --primary: #ff4500;
    --primary-dark: #e03d00;
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #333333;
    --success: #46d160;
    --error: #ff4444;
    --info: #0079d3;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form input[type="text"],
.form input[type="url"] {
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
}

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

/* Buttons */
.btn, button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn:hover, button[type="submit"]:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.inline-form {
    display: flex;
    flex: 1;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 1rem;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filters a {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
}

.filters a:hover,
.filters a.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1.5rem;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reddit-link {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.reddit-link:hover {
    opacity: 1;
    background: var(--primary);
}

.post-thumbnail {
    width: 100%;
    height: 180px;
    min-height: 180px;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.post-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: auto;
    padding-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.author-link {
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.author-link:hover {
    text-decoration: underline;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-top: auto;
    padding-top: 0.75rem;
}

.post-actions > * {
    flex: 1;
    display: flex;
}

.post-actions .btn-action {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.3rem;
    font-size: 0.8rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

.post-actions form,
.post-actions .inline-form {
    margin: 0;
    padding: 0;
}

.post-actions form .btn-action,
.post-actions .inline-form .btn-action {
    width: 100%;
    height: 100%;
}

.btn-video {
    background: linear-gradient(135deg, #ff6b6b, #ff4500);
    border-color: #ff4500;
    color: white;
}

.btn-video:hover {
    background: linear-gradient(135deg, #ff8585, #ff6b35);
    border-color: #ff6b35;
}

/* Video Library */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-info {
    flex: 1;
}

.video-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.video-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.badge-generated {
    background: linear-gradient(135deg, #ff6b6b, #ff4500);
}

.badge-downloaded {
    background: var(--info);
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

/* Post Layout - Two Column */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.post-media-column {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    height: fit-content;
    align-self: start;
    max-height: calc(100vh - 4rem);
}

.post-content-column {
    min-height: 100vh;
}

.post-content-column h1 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.post-meta-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.media-container {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
}

.media-sticky {
    width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
    display: block;
}

.gallery-sticky {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.gallery-sticky .gallery-item img {
    width: 100%;
    border-radius: 4px;
}

.self-text-sticky {
    padding: 1.5rem;
    white-space: pre-wrap;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.link-container {
    padding: 1.5rem;
}

.link-container a {
    color: var(--info);
    word-break: break-all;
}

.embed-container {
    padding: 1.5rem;
}

.action-bar {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.action-bar label {
    display: block;
    margin-bottom: 1rem;
    cursor: pointer;
}

.action-bar input[type="checkbox"] {
    margin-right: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.action-buttons .inline-form {
    flex: 1;
}

.action-buttons .btn-lg {
    width: 100%;
}

/* Comments */
.comments-section {
    margin-top: 2rem;
}

.comments-section h2 {
    margin-bottom: 1rem;
}

.comment {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-IMAGE {
    background: #4caf50;
    color: white;
}

.badge-VIDEO {
    background: #2196f3;
    color: white;
}

.badge-GALLERY {
    background: #9c27b0;
    color: white;
}

.badge-RICH_VIDEO {
    background: #ff9800;
    color: white;
}

.badge-LINK {
    background: #607d8b;
    color: white;
}

.badge-SELF {
    background: #795548;
    color: white;
}

.badge-POLL {
    background: #e91e63;
    color: white;
}

/* Stats */
.stats-container {
    max-width: 600px;
    margin: 0 auto;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

.type-breakdown {
    margin: 1.5rem 0;
}

.type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.type-row span:first-child {
    width: 100px;
    font-size: 0.875rem;
}

.bar-container {
    flex: 1;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    background: var(--primary);
    padding: 0.5rem;
    font-size: 0.875rem;
    min-width: 30px;
    transition: width 0.3s ease;
}

/* Alerts */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(70, 209, 96, 0.1);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
}

/* Action Links */
.action-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Hidden utility */
.hidden {
    display: none;
}

/* Text muted */
.text-muted {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* Subreddits Page */
.subreddits-page {
    padding: 1rem 0;
}

.subreddits-page h1 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.page-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.theme-section {
    margin-bottom: 2rem;
}

.theme-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.subreddit-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.subreddit-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-height: 48px;
}

.chip-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subreddit-chip:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 69, 0, 0.2);
}

.subreddit-chip:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .subreddit-chips {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .subreddit-chips {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .subreddit-chip {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .chip-icon {
        font-size: 1rem;
    }

    .theme-section h2 {
        font-size: 1.1rem;
    }
}

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

/* Post Layout Responsive */
@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
    }
    
    .post-media-column {
        position: relative;
        top: 0;
    }
    
    .media-sticky,
    .gallery-sticky,
    .self-text-sticky {
        max-height: none;
    }
}

/* ============================================
   VIDEO EDITOR STYLES
   ============================================ */

/* Editor Sections */
.editor-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.editor-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Source Tabs */
.source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(255, 69, 0, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 3rem;
}

.upload-placeholder p {
    font-size: 1.1rem;
    color: var(--text);
}

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

/* Video Select Grid (Library) */
.video-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.video-select-item {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.video-select-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.video-thumb {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-select-name {
    display: block;
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-select-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Editor Workspace */
.editor-workspace {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.editor-workspace.hidden {
    display: none;
}

/* Video Preview */
.video-preview-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-preview-container video {
    width: 100%;
    max-height: 400px;
    display: block;
}

/* Timeline */
.timeline-container {
    margin-bottom: 1.5rem;
}

.timeline-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.timeline {
    position: relative;
    height: 40px;
    background: var(--surface-light);
    border-radius: 4px;
    cursor: pointer;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 69, 0, 0.3);
    border-radius: 4px;
    pointer-events: none;
}

.trim-region {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 69, 0, 0.5);
    border-radius: 4px;
    pointer-events: none;
}

.trim-handle {
    position: absolute;
    top: -5px;
    width: 12px;
    height: 50px;
    background: var(--primary);
    border-radius: 4px;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.trim-handle:hover {
    background: var(--primary-dark);
}

/* Cut Controls */
.cut-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.time-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-field {
    text-align: center;
}

.time-field label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
}

.time-input-group input {
    width: 50px;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: center;
    font-size: 1rem;
}

.time-input-group input:focus {
    outline: none;
}

.time-input-group span {
    color: var(--text-muted);
}

.time-separator {
    font-size: 1.5rem;
    color: var(--primary);
}

.cut-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-overlay.hidden {
    display: none;
}

.processing-content {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.progress-bar {
    width: 300px;
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem auto 0;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Result Section */
.result-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.result-section.hidden {
    display: none;
}

.result-section h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.save-notice {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.result-preview {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.result-preview video {
    width: 100%;
    max-height: 400px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Button secondary variant */
.btn-secondary {
    background: var(--surface-light);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   VIDEO STITCHER STYLES
   ============================================ */

.video-queue {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 150px;
}

.video-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.video-queue-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.video-queue-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.queue-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.queue-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.queue-item:hover {
    border-color: var(--primary);
}

.queue-item-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.queue-item-actions {
    display: flex;
    gap: 0.5rem;
}

.queue-item-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1rem;
}

.queue-item-btn:hover {
    background: var(--surface);
    color: var(--primary);
}

.queue-item-btn.remove:hover {
    color: #ff4444;
}

.video-library-section {
    margin-top: 2rem;
}

.video-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.video-library-item {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.video-library-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.video-library-item.selected {
    border-color: var(--primary);
    background: rgba(255, 69, 0, 0.1);
}

.video-library-item.in-queue {
    opacity: 0.5;
    pointer-events: none;
}

.video-library-thumb {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.video-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumb-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.8;
    transition: opacity 0.2s;
    pointer-events: none;
}

.video-thumb-container:hover .play-overlay {
    opacity: 1;
}

.video-thumb-container:hover .video-thumb-preview {
    opacity: 0.7;
}

.video-library-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.video-modal.hidden {
    display: none;
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

.video-modal-content video {
    width: 100%;
    max-height: 80vh;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--text);
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.video-modal-close:hover {
    background: var(--primary);
}

.video-library-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-library-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stitch-controls {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.control-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
}

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

.stitch-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-stitch {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-stitch:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 69, 0, 0.4);
}

.btn-stitch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stitch-page .drag-over {
    background: rgba(255, 69, 0, 0.1) !important;
    border-color: var(--primary) !important;
    border-style: dashed !important;
}

.section-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.section-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.section-tab:hover {
    color: var(--text);
    background: var(--surface);
}

.section-tab.active {
    color: var(--primary);
    background: rgba(255, 69, 0, 0.1);
}

.section-content {
    display: none;
}

.section-content.active {
    display: block;
}

/* Responsive for Editor */
@media (max-width: 768px) {
    .time-inputs {
        flex-direction: column;
    }
    
    .time-separator {
        transform: rotate(90deg);
    }
    
    .cut-actions {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .video-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .video-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ============================================
   PUBLISH PAGE STYLES
   ============================================ */

.publish-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

.publish-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.publish-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.publish-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    width: 100%;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.selected-video-info {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .publish-layout {
        grid-template-columns: 1fr;
    }
}
