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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f7;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

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

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

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #1a1a1a;
}

header p {
    color: #666;
    font-size: 0.95rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #444;
}

.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #333;
}

.form-group input[type="url"]:focus,
.form-group select:focus {
    border-color: #0070c9;
}

button {
    background: #0070c9;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #005a9e;
}

button:disabled {
    background: #9cc3e8;
    cursor: not-allowed;
}

.message {
    margin-top: 12px;
    font-size: 0.95rem;
}

.message.success { color: #2e7d32; }
.message.error { color: #c62828; }
.message.info { color: #1565c0; }

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item .url {
    color: #1a73e8;
    word-break: break-all;
    max-width: 60%;
}

.task-item .status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

.task-item .status.completed {
    background: #e6f4ea;
    color: #2e7d32;
}

.task-item .status.failed {
    background: #fbe9e7;
    color: #c62828;
}

.task-item .status.downloading {
    background: #fff4e6;
    color: #e65100;
}

.task-item .actions {
    display: flex;
    gap: 8px;
}

.btn-download {
    background: #2e7d32;
    font-size: 0.85rem;
    padding: 6px 12px;
}

.btn-download:hover {
    background: #1b5e20;
}

.empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0070c9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Прогресс-бар */
.progress-container {
    margin-top: 8px;
    width: 100%;
    max-width: 300px;
}

.progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar {
    height: 100%;
    background: #0070c9;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 600px) {
    body { padding: 12px; }
    .card { padding: 16px; }
    .task-item .url { max-width: 45%; }
}
