/* style.css */

/* === ЦВЕТОВАЯ ПАЛИТРА === */
:root {
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e0e4eb;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --primary: #3182ce;
    --primary-hover: #2c5282;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #dd6b20;
    --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 10px;
}

/* === Основные стили === */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 24px;
}

/* === Шапка === */
.header {
    text-align: center;
    margin-bottom: 36px;
    padding: 20px 0;
}

.header h1 {
    margin: 0;
    font-size: 2.3em;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 10px;
    font-size: 1.1em;
}

/* === Карточки === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 28px;
    transition: box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* === Загрузка файлов === */
.file-upload-group {
    margin-bottom: 20px;
}

.file-upload-group.compact {
    margin-bottom: 16px;
}

.file-label {
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.file-label small {
    color: var(--text-secondary);
    font-size: 0.88em;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.file-button {
    padding: 8px 16px;
    background: #edf2f7;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--primary);
    border: 1px solid #cbd5e0;
    transition: all 0.2s;
}

.file-button:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
}

.file-name {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.file-name.has-file {
    color: var(--success);
    font-weight: 600;
}

.file-info {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Кнопки === */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: none;
    padding: 0;
    font-weight: 600;
    font-size: 0.95em;
}

.btn-link:hover {
    text-decoration: underline;
}

/* === Прогресс === */
.progress-container {
    margin-top: 24px;
}

.progress-bar {
    height: 10px;
    background: #edf2f7;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

/* === Дашборд === */
.dashboard-row {
    display: flex;
    gap: 28px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.dashboard-section {
    flex: 1;
    min-width: 320px;
}

.section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* === Поля фильтра === */
.filter-input {
    padding: 10px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    min-width: 180px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-input:hover {
    border-color: #a0aec0;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.25);
}

.filter-input::placeholder {
    color: #a0aec0;
    font-style: normal;
}

/* === Кнопки обновления === */
.btn-refresh {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    color: #718096;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-refresh:hover {
    background: #f7fafc;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn-refresh:active {
    transform: translateY(0) rotate(20deg);
}

/* === Таблицы === */
.table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.text-center {
    text-align: center;
    color: var(--text-secondary);
    padding: 16px;
    font-style: italic;
}

/* === Статусы === */
.status-success,
.status-error {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.status-success { color: var(--success); }
.status-error { color: var(--danger); }

/* === Сообщения === */
.success, .error, .warning {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success { background: #f0fff4; color: var(--success); border-left: 4px solid var(--success); }
.error { background: #fff5f5; color: var(--danger); border-left: 4px solid var(--danger); }
.warning { background: #fffaf0; color: var(--warning); border-left: 4px solid var(--warning); }

/* === Футер === */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #edf2f7;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.api-info {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

/* === Модальные окна === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: flex-start; /* ← чтобы не прыгало при длинном тексте */
    padding-top: 80px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f7fafc;
    color: var(--text-primary);
}

.modal-body input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    margin: 12px 0;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .dashboard-row {
        flex-direction: column;
    }

    .filter-input {
        min-width: 140px;
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .btn-refresh {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* Скрыть оригинальное поле выбора файла */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Новый стиль загрузки файлов === */

.file-upload-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.file-upload-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05em;
}

.file-input-area {
    position: relative;
}

.file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 140px;
    position: relative;
    width: 100%;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: #edf7ff;
}

.file-dropzone i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-dropzone span {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-dropzone small {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Скрыть input, но оставить функциональным */
.file-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 0.95em;
    color: var(--text-secondary);
    text-align: center;
}

.file-name.has-file {
    color: var(--success);
    font-weight: 600;
}

/* Кнопка отправки */
.btn-lg {
    padding: 12px 28px;
    font-size: 1.1em;
    border-radius: 10px;
}

/* Адаптивность */
@media (max-width: 600px) {
    .file-dropzone {
        padding: 18px;
        min-height: 120px;
    }

    .file-dropzone i {
        font-size: 24px;
    }
}

/* === Горизонтальная загрузка файлов === */

.file-upload-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.file-upload-item {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05em;
}

.file-input-area {
    position: relative;
}

.file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 160px;
    position: relative;
    width: 100%;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: #edf7ff;
}

.file-dropzone i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-dropzone span {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-dropzone small {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Скрыть input, но оставить функциональным */
.file-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 0.95em;
    color: var(--text-secondary);
    text-align: center;
}

.file-name.has-file {
    color: var(--success);
    font-weight: 600;
}

/* Кнопка на всю ширину */
.btn-full-width {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1em;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease;
}

.btn-full-width:hover {
    transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .file-upload-row {
        flex-direction: column;
        gap: 20px;
    }

    .file-upload-item {
        min-width: 100%;
    }

    .file-dropzone {
        min-height: 140px;
        padding: 20px;
    }
}