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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --accent-dim: #991111;
    --success: #28a745;
    --error: #dc3545;
    --border: #2a2a4a;
    --radius: 8px;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 6px;
}

/* Banner */
.banner {
    background: var(--accent-dim);
    color: #fff;
    text-align: center;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Mode tabs */
.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.tab.active {
    background: var(--accent);
    color: #fff;
}

/* Form */
.form-section {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 14px;
}

label:first-child {
    margin-top: 0;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

input[type="text"]::placeholder {
    color: #555;
}

#submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

#submit-btn:hover {
    background: var(--accent-hover);
}

#submit-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.queue-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 14px;
}

/* Tasks */
.tasks-section h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-cities {
    font-weight: 600;
    font-size: 1.05rem;
}

.task-status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.status-queued {
    background: #333;
    color: #aaa;
}

.status-processing {
    background: #1a3a5c;
    color: #6cb4ee;
}

.status-completed {
    background: #1a3c1a;
    color: var(--success);
}

.status-failed {
    background: #3c1a1a;
    color: var(--error);
}

.task-progress {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.task-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.task-video {
    margin-top: 12px;
}

.task-video video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
}

.task-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.btn-download {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

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

.task-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #6cb4ee;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px 12px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .form-section {
        padding: 18px;
    }
}
