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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

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

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

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

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

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

.nav-link:hover {
    color: var(--text);
}

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

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

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

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

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text);
}

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

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

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

.btn-full {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

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

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

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Upload Area */
.upload-section {
    margin-bottom: 2rem;
}

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

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--text-muted);
}

/* Progress */
.upload-progress {
    padding: 2rem;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--bg-lighter);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.progress-text {
    color: var(--text-muted);
}

/* Divider */
.or-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.or-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.video-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.video-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.video-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Video List */
.search-bar {
    margin-bottom: 1.5rem;
}

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

.video-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-icon-small {
    color: var(--primary);
}

.video-details .video-name {
    margin-bottom: 0.25rem;
}

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

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

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

.modal-content {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.modal-small {
    max-width: 400px;
}

.modal-content h2,
.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Processing Steps */
.processing-steps {
    margin: 1.5rem 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.step.active {
    background: rgba(99, 102, 241, 0.1);
    opacity: 1;
}

.step.complete {
    opacity: 1;
}

.step.complete .step-icon {
    background: var(--success);
}

.step-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Result Page */
.result-container {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--text);
    background: var(--bg-lighter);
}

.tab-content {
    padding: 1.5rem;
}

.content-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.content-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.content-box h1,
.content-box h2,
.content-box h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-box h1:first-child,
.content-box h2:first-child,
.content-box h3:first-child {
    margin-top: 0;
}

.content-box p {
    margin-bottom: 1rem;
}

.content-box ul,
.content-box ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-box li {
    margin-bottom: 0.5rem;
}

.content-box code {
    background: var(--bg-lighter);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.content-box pre {
    background: var(--bg-lighter);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.content-box pre code {
    background: none;
    padding: 0;
}

/* Utilities */
.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.error {
    color: var(--danger);
}

.no-videos,
.no-content {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.no-content a {
    color: var(--primary);
}

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

    .video-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .video-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .content-actions {
        flex-direction: column;
    }

    .content-actions .btn {
        width: 100%;
    }
}
