:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --border-color: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 768px;
    margin: 0 auto;
}

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

h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.login-card {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.card-title {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

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

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Form elements */
.input-group {
    margin-bottom: 16px;
}

input[type="url"], input[type="password"], select {
    width: 100%;
    padding: 14px 16px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row select {
    flex: 2;
    margin-bottom: 0;
}

.form-row button {
    flex: 1;
}

/* Buttons */
button, .btn-logout {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 14px 24px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.w-100 {
    width: 100%;
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background: var(--border-color);
    color: white;
}

.btn-icon {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-dl { background: var(--success); }
.btn-dl:hover { background: #059669; }
.btn-del { background: var(--danger); }
.btn-del:hover { background: #dc2626; }

/* Alerts / Badges */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert.error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }

.badge {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* File list & Tasks */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item, .task-item {
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    overflow: hidden;
    margin-right: 16px;
}

.file-name {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 0;
}

/* Progress Bar */
.task-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.task-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.progress-container {
    width: 100%;
    background: var(--border-color);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 99px;
}

.task-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

@media (max-width: 600px) {
    .form-row { flex-direction: column; }
    .file-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .file-actions { width: 100%; justify-content: flex-end; }
}
