:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

.background-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    z-index: -1;
    border-radius: 50%;
}

.blob-2 {
    top: auto;
    left: auto;
    bottom: -200px;
    right: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary);
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.controls-card {
    padding: 2rem;
    margin-bottom: 3rem;
    transition: transform 0.3s ease;
}

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

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

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

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"], 
input[type="password"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: background 0.2s, transform 0.1s;
}

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

.primary-btn:active {
    transform: translateY(0);
}

/* Custom File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.2s;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-dummy {
    text-align: center;
    color: var(--text-secondary);
}

.file-dummy i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-dummy .success { display: none; color: var(--accent); }

.file-selected .file-dummy .default { display: none; }
.file-selected .file-dummy .success { display: block; }
.file-selected { border-color: var(--accent); }

.hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Jobs Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.icon-btn {
    background: var(--glass-border);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.jobs-grid {
    display: grid;
    gap: 1rem;
}

.job-item {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.job-info {
    flex: 1;
}

.job-query {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.job-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pending { background: #f59e0b22; color: #fbbf24; }
.badge-in_progress { background: #3b82f622; color: #60a5fa; }
.badge-completed { background: #10b98122; color: #34d399; }
.badge-failed { background: #ef444422; color: #f87171; }

.job-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn {
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.download-btn:hover {
    transform: scale(1.05);
}

.progress-bar {
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: all 0.3s ease;
}

.toast.hidden { transform: translateX(200%); }

@media (max-width: 600px) {
    .container { padding: 1rem; }
    .logo h1 { font-size: 2rem; }
    .job-item { flex-direction: column; align-items: flex-start; }
    .job-actions { width: 100%; justify-content: flex-end; }
}
