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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

nav {
    background: #1a1a2e;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #ff6b35;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links a {
    color: #aaa;
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

main { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.container { width: 100%; }

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

h1 { font-size: 1.8rem; }

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    background: #333;
    color: #fff;
    transition: background 0.2s;
}
.btn:hover { background: #444; }
.btn-primary { background: #ff6b35; color: #fff; }
.btn-primary:hover { background: #e55a2b; }
.btn-danger { background: #d9534f; color: #fff; }
.btn-danger:hover { background: #c9302c; }

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-queued { background: #555; color: #fff; }
.badge-processing { background: #f0ad4e; color: #000; }
.badge-completed { background: #5cb85c; color: #fff; }
.badge-failed { background: #d9534f; color: #fff; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.2rem;
}

.video-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.video-card:hover { border-color: #ff6b35; }

.video-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.video-card h3 { font-size: 1rem; margin-bottom: 0.8rem; line-height: 1.4; }

.video-card-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.subreddit { color: #ff6b35; font-size: 0.8rem; }

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: #666;
    font-size: 1.1rem;
}

.form { max-width: 600px; margin-top: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: #aaa; font-size: 0.9rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}
.input:focus { outline: none; border-color: #ff6b35; }

select.input { cursor: pointer; }

.tabs { display: flex; gap: 0; margin-bottom: 0; }
.tab {
    padding: 0.6rem 1.5rem;
    background: #1a1a2e;
    border: 1px solid #333;
    border-bottom: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 6px 6px 0 0;
}
.tab.active { background: #222; color: #fff; border-color: #555; }

.posts-list { margin: 1rem 0; max-height: 400px; overflow-y: auto; }
.post-item {
    padding: 0.8rem;
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.post-item:hover { border-color: #666; }
.post-item.selected { border-color: #ff6b35; background: #1a1a2e; }

.back-link { color: #888; text-decoration: none; display: block; margin-bottom: 1.5rem; }
.back-link:hover { color: #fff; }

.video-detail-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.video-detail-header h1 { font-size: 1.5rem; flex: 1; }

.video-meta { display: flex; gap: 1.5rem; color: #888; font-size: 0.9rem; margin-bottom: 2rem; }

.video-player { margin-bottom: 1.5rem; }
.video-player video { border-radius: 8px; max-width: 100%; }

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

.alert { padding: 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: #2d1515; border: 1px solid #d9534f; color: #ff6b6b; }

.processing-status { text-align: center; padding: 3rem 0; }

.progress-bar-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 1rem;
    background: #222;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    border: 1px solid #333;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8f65);
    border-radius: 8px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-text {
    color: #aaa;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
