/* ==========================================================================
   Devinf — основные стили проекта
   Требуется: Bulma 1.x, Font Awesome 6.x
   Основной цвет: #2c4258
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Переменные (палитра вокруг #2c4258)
   -------------------------------------------------------------------------- */
:root {
    /* Основные оттенки синего */
    --brand-primary: #2c4258;          /* основной */
    --brand-dark: #1e2f3f;             /* тёмный (hover, акценты) */
    --brand-light: #3d5a73;            /* светлый (градиент) */
    --brand-lighter: #5a7691;          /* очень светлый (иконки, ссылки) */

    /* Градиент на основе основного цвета */
    --brand-gradient: linear-gradient(135deg, #3d5a73 0%, #2c4258 100%);
    --brand-gradient-hover: linear-gradient(135deg, #2c4258 0%, #1e2f3f 100%);

    /* Фоны и границы */
    --surface-bg: #f4f6f8;             /* холодный светлый фон страницы */
    --surface-bg-alt: #e8edf2;         /* фон заголовков таблицы */
    --surface-border: #d3dae1;         /* границы */
    --surface-white: #ffffff;

    /* Текст */
    --text-primary: #1e2f3f;
    --text-muted: #5c6b7a;
    --text-dim: #8a97a5;

    /* Футер */
    --footer-bg: #1e2f3f;
    --footer-text: #c5d0da;
    --footer-muted: #8a9aab;
    --footer-dim: #6a7a8a;

    /* Уведомления */
    --danger-bg: #fdecec;
    --danger-border: #f5b5b5;
    --danger-text: #a12a2a;

    --success-bg: #e8f5ee;
    --success-border: #a8d8bd;
    --success-text: #1f6b45;

    /* Тени */
    --shadow-sm: 0 2px 10px rgba(44, 66, 88, 0.06);
    --shadow-md: 0 4px 20px rgba(44, 66, 88, 0.08);
    --shadow-lg: 0 8px 28px rgba(44, 66, 88, 0.14);
    --shadow-brand: 0 6px 18px rgba(44, 66, 88, 0.35);
}

/* --------------------------------------------------------------------------
   2. Базовый каркас страницы
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--surface-bg);
    color: var(--text-primary);
}

.page-content {
    flex: 1 0 auto;
    animation: fadeInUp 0.45s ease-out;
}

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

/* --------------------------------------------------------------------------
   3. Хедер
   -------------------------------------------------------------------------- */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .navbar-item {
    color: var(--brand-primary);
}

.site-header .navbar-item .icon {
    color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   4. Футер
   -------------------------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2.5rem 1.5rem 1.5rem;
    margin-top: 3rem;
}

.site-footer a {
    color: #fff;
    transition: opacity 0.2s ease;
}

.site-footer a:hover {
    opacity: 0.75;
}

.footer-logo {
    max-height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2rem 0 1rem;
}

.footer-icon {
    color: var(--brand-lighter);
    margin-right: 0.4rem;
}

/* --------------------------------------------------------------------------
   5. Кнопки и карточки
   -------------------------------------------------------------------------- */
.button.is-brand {
    background: var(--brand-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button.is-brand:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
    color: #fff;
}

.button.is-brand:focus-visible {
    outline: 2px solid var(--brand-lighter);
    outline-offset: 2px;
}

/* Вторичная кнопка (для «Файлы» в карточках) */
.button.is-light {
    background-color: var(--surface-bg-alt);
    border-color: var(--surface-border);
    color: var(--brand-primary);
}

.button.is-light:hover {
    background-color: var(--surface-bg);
    border-color: var(--brand-lighter);
    color: var(--brand-dark);
}

.card {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--surface-border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header-title .icon {
    color: var(--brand-primary) !important;
}

/* --------------------------------------------------------------------------
   6. Табы
   -------------------------------------------------------------------------- */
.tabs.is-boxed li.is-active a {
    background: var(--brand-gradient);
    border-color: transparent;
    color: #fff;
}

.tabs.is-boxed li.is-active a .icon {
    color: #fff;
}

.tabs a {
    border-radius: 8px 8px 0 0;
    color: var(--brand-primary);
}

.tabs a:hover {
    color: var(--brand-dark);
    border-bottom-color: var(--brand-primary);
}

/* Неактивный (отключённый) таб */
.tabs li.is-disabled a {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    color: var(--text-dim);
}

.tabs li.is-disabled a:hover {
    background-color: transparent;
    border-color: transparent;
}

/* --------------------------------------------------------------------------
   7. Уведомления (согласованы с палитрой)
   -------------------------------------------------------------------------- */
.notification {
    border-radius: 10px;
}

.notification.is-danger.is-light {
    background-color: var(--danger-bg);
    border-left: 4px solid var(--danger-text);
    color: var(--danger-text);
}

.notification.is-success.is-light {
    background-color: var(--success-bg);
    border-left: 4px solid var(--success-text);
    color: var(--success-text);
}

/* --------------------------------------------------------------------------
   8. Поля формы
   -------------------------------------------------------------------------- */
.label {
    color: var(--text-primary);
    font-weight: 600;
}

.input,
.select select,
.textarea {
    border-color: var(--surface-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:hover,
.select select:hover,
.textarea:hover {
    border-color: var(--brand-lighter);
}

.input:focus,
.select select:focus,
.textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(44, 66, 88, 0.15);
}

.help {
    color: var(--text-muted);
}

.help.is-danger {
    color: var(--danger-text);
}

/* --------------------------------------------------------------------------
   9. Страница формы загрузки
   -------------------------------------------------------------------------- */

/* Карточки вариантов */
.is-variant-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
}

.is-variant-card .card-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.is-variant-card .card-image {
    overflow: hidden;
}

.is-variant-card .card-image img {
    object-fit: cover;
    transition: transform 0.3s ease;
}

.is-variant-card:hover .card-image img {
    transform: scale(1.04);
}

.is-variant-card .title {
    color: var(--brand-primary);
}

/* Блок с видеоинструкцией */
.video-wrapper {
    animation: fadeIn 0.35s ease-out;
}

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

/* --------------------------------------------------------------------------
   10. Страница результатов
   -------------------------------------------------------------------------- */

/* Заголовки */
.title {
    color: var(--brand-primary);
}

.subtitle {
    color: var(--text-muted);
}

/* Таблица */
.table thead th {
    background-color: var(--surface-bg-alt);
    color: var(--brand-primary);
    font-weight: 600;
    white-space: nowrap;
}

.table th,
.table td {
    text-align: center;
    vertical-align: middle;
    font-size: 0.875rem;
    border-color: var(--surface-border) !important;
}

.table tbody tr:hover {
    background-color: rgba(44, 66, 88, 0.04) !important;
}

/* Первые три столбца — выравнивание влево */
.table th:nth-child(-n+3),
.table td:nth-child(-n+3) {
    text-align: left;
    white-space: nowrap;
}

/* Sticky-столбец «ФИО» */
.table thead th:first-child,
.table tbody td:first-child {
    position: sticky;
    left: 0;
    background-color: var(--surface-white);
    z-index: 2;
    box-shadow: 2px 0 4px rgba(44, 66, 88, 0.06);
}

.table thead th:first-child {
    background-color: var(--surface-bg-alt);
    z-index: 3;
}

/* Скролл-контейнер таблицы */
.table-container {
    max-height: 70vh;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
}

.table-container table {
    margin-bottom: 0;
}

/* Графики */
.is-graph img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--surface-border);
}

/* --------------------------------------------------------------------------
   11. Адаптивность
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .site-footer {
        padding: 2rem 1rem 1rem;
    }

    .table th,
    .table td {
        font-size: 0.8rem;
    }

    .table-container {
        max-height: 60vh;
    }

    .button.is-brand {
        font-size: 0.85rem;
    }
}