/* Базовые стили и анимации */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Drag-and-drop визуальный фидбек */
#dropzone.dragover {
    border-color: #7c3aed;
    background-color: rgba(124, 58, 237, 0.08);
}

/* Прогресс-бар */
.progress-bar-container {
    background-color: #1e1e3a;
    border-radius: 999px;
    overflow: hidden;
    height: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.3s ease;
}

.progress-bar-fill.error {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.progress-bar-fill.done {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

/* Файл-карточка */
.file-card {
    background-color: #16213e;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background-color 0.2s;
}

.file-card:hover {
    background-color: #1a2744;
}

.file-card .file-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: rgba(124, 58, 237, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card .file-info {
    flex: 1;
    min-width: 0;
}

.file-card .file-name {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card .file-size {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.file-card .file-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.file-card .file-remove:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Прогресс-карточка */
.progress-card {
    background-color: #16213e;
    border-radius: 12px;
    padding: 14px 18px;
}

.progress-card .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-card .progress-name {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 12px;
}

.progress-card .progress-percent {
    font-size: 13px;
    color: #a78bfa;
    font-weight: 600;
    white-space: nowrap;
}

.progress-card .progress-percent.done {
    color: #4ade80;
}

.progress-card .progress-percent.error {
    color: #f87171;
}

/* Результат-карточка */
.result-card {
    background-color: #16213e;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-card .result-name {
    font-size: 14px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 12px;
}

.result-card .result-download {
    flex-shrink: 0;
    background-color: #16a34a;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.result-card .result-download:hover {
    background-color: #15803d;
}

/* Спиннер внутри кнопки */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Пульсирующая анимация для загрузки */
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}
