﻿/* =========================================================
   ШАБЛОНЫ WORD
   Страница /Templates
   ========================================================= */

.templates-page {
    min-height: calc(100vh - 80px);
    background: #F5F7FA;
    color: #2D3138;
}

.templates-shell {
    width: min(1300px, calc(100% - 48px));
    margin: 0 auto;
}


/* =========================================================
   HERO
   ========================================================= */

.templates-hero {
    padding: 34px 0 24px;
    border-bottom: 1px solid #DFE7F0;
    background: radial-gradient(circle at 18% 20%, rgba(43, 87, 154, 0.10), transparent 34%), linear-gradient(180deg, #FFFFFF 0%, #F6F9FD 100%);
}

.templates-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 840px;
    margin: 0 auto;
    text-align: center;
}

    .templates-hero__content > div:last-child {
        width: 100%;
        text-align: center;
    }

.templates-hero__icon {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    margin-bottom: 2px;
    border: 1px solid #C9D9EC;
    border-radius: 12px;
    background: #FFFFFF;
    color: #2B579A;
    box-shadow: 0 6px 18px rgba(43, 87, 154, 0.10);
    font-size: 1.8rem;
}

.templates-kicker {
    display: block;
    margin-bottom: 3px;
    color: #6C7F98;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.templates-hero h1 {
    margin: 0;
    color: #2B579A;
    font-size: clamp(2rem, 4vw, 2.65rem);
    line-height: 1.05;
}

.templates-hero p {
    max-width: 720px;
    margin: 8px auto 0;
    color: #627083;
    font-size: 0.98rem;
    line-height: 1.5;
}


/* =========================================================
   ПОИСК
   ========================================================= */

.templates-search {
    display: flex;
    align-items: center;
    width: min(680px, 100%);
    margin: 20px auto 0;
    padding: 0 13px;
    border: 1px solid #CFD9E6;
    border-radius: 9px;
    background: #FFFFFF;
    box-shadow: 0 4px 15px rgba(31, 58, 93, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .templates-search:focus-within {
        border-color: #2B579A;
        box-shadow: 0 0 0 3px rgba(43, 87, 154, 0.10);
    }

    .templates-search > i {
        flex: 0 0 auto;
        color: #8190A3;
    }

    .templates-search input {
        width: 100%;
        min-width: 0;
        padding: 12px 12px;
        border: 0;
        outline: 0;
        background: transparent;
        color: #303744;
        font: inherit;
    }

        .templates-search input::placeholder {
            color: #99A4B2;
        }

.templates-search__clear {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8C98A8;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

    .templates-search__clear.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .templates-search__clear:hover {
        background: #EEF3F8;
        color: #2B579A;
    }


/* =========================================================
   КАТАЛОГ
   ========================================================= */

.templates-catalog {
    padding: 24px 0 50px;
}

.templates-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.templates-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-filter {
    padding: 8px 14px;
    border: 1px solid #D2DBE7;
    border-radius: 999px;
    background: #FFFFFF;
    color: #526173;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

    .template-filter:hover {
        border-color: #9EB6D5;
        color: #2B579A;
    }

    .template-filter.active {
        border-color: #2B579A;
        background: #2B579A;
        color: #FFFFFF;
        box-shadow: 0 3px 9px rgba(43, 87, 154, 0.18);
    }


/* =========================================================
   СЕТКА ШАБЛОНОВ
   ========================================================= */

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}


/* =========================================================
   КАРТОЧКА
   Hover повторяет карточки микросервисов
   ========================================================= */

.template-library-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 270px;
    cursor: pointer;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

    .template-library-card:hover {
        transform: translateY(5px);
        border-color: #2B579A;
        background-color: #F7FBFF;
        box-shadow: 0 8px 18px rgba(43, 87, 154, 0.25);
    }

    .template-library-card:active {
        transform: translateY(3px) scale(0.99);
    }

    .template-library-card[hidden] {
        display: none !important;
    }


.template-library-card__top,
.template-library-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.template-file-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 9px;
    background: #EDF4FC;
    color: #2B579A;
    font-size: 1.35rem;
}


.template-badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: #EAF2FC;
    color: #2B579A;
    font-size: 0.72rem;
    font-weight: 700;
}

.template-badge--accent {
    background: #EEF5FF;
    color: #24518F;
}


.template-library-card__body {
    flex: 1 1 auto;
    padding: 18px 0;
}


.template-category {
    display: block;
    margin-bottom: 7px;
    color: #8290A1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}


.template-library-card h2 {
    margin: 0 0 9px;
    color: #303947;
    font-size: 1.08rem;
    line-height: 1.3;
}


.template-library-card p {
    margin: 0;
    color: #69778A;
    font-size: 0.9rem;
    line-height: 1.52;
}


.template-library-card__footer {
    padding-top: 15px;
    border-top: 1px solid #EDF0F4;
}


.template-format {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8996A6;
    font-size: 0.78rem;
    font-weight: 700;
}


.template-download {
    padding: 8px 14px;
    border: 1px solid #2B579A;
    border-radius: 6px;
    background: #FFFFFF;
    color: #2B579A;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

    .template-download:hover {
        background: #2B579A;
        color: #FFFFFF;
        box-shadow: 0 4px 10px rgba(43, 87, 154, 0.18);
    }


/* =========================================================
   НИЧЕГО НЕ НАЙДЕНО
   ========================================================= */

.templates-empty {
    padding: 56px 20px;
    text-align: center;
}

.templates-empty__icon {
    margin-bottom: 12px;
    color: #9AA8B8;
    font-size: 2rem;
}

.templates-empty h2 {
    margin: 0 0 5px;
    color: #3C4653;
    font-size: 1.15rem;
}

.templates-empty p {
    margin: 0;
    color: #7A8796;
}


/* =========================================================
   ПРЕДУПРЕЖДЕНИЕ
   ========================================================= */

.templates-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 22px;
    padding: 15px 17px;
    border: 1px solid #D7E2EF;
    border-radius: 9px;
    background: #F8FBFF;
}

.templates-note__icon {
    flex: 0 0 auto;
    padding-top: 1px;
    color: #2B579A;
}

.templates-note strong {
    color: #40526A;
    font-size: 0.9rem;
}

.templates-note p {
    margin: 3px 0 0;
    color: #718096;
    font-size: 0.84rem;
    line-height: 1.45;
}


/* =========================================================
   DEMO TOAST
   ========================================================= */

.template-demo-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(420px, calc(100vw - 44px));
    padding: 13px 16px;
    border: 1px solid #C9D9EC;
    border-radius: 9px;
    background: #FFFFFF;
    color: #3C4C60;
    box-shadow: 0 12px 32px rgba(31, 53, 80, 0.18);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

    .template-demo-toast i {
        color: #2B579A;
        font-size: 1.2rem;
    }

    .template-demo-toast.visible {
        opacity: 1;
        transform: translateY(0);
    }


/* =========================================================
   ADAPTIVE
   ========================================================= */

@media (min-width: 1280px) {

    .templates-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


@media (max-width: 960px) {

    .templates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 720px) {

    .templates-shell {
        width: min(100% - 28px, 1300px);
    }

    .templates-hero {
        padding: 30px 0 22px;
    }

    .templates-hero__content {
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        text-align: center;
    }

    .templates-hero__icon {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
        border-radius: 11px;
        font-size: 1.6rem;
    }

    .templates-toolbar {
        margin-bottom: 16px;
    }
}


@media (max-width: 600px) {

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .templates-hero__content {
        gap: 13px;
    }

    .templates-kicker {
        font-size: 0.7rem;
    }

    .templates-hero p {
        font-size: 0.92rem;
    }

    .templates-search {
        margin-top: 18px;
    }

    .templates-filters {
        gap: 7px;
    }

    .template-filter {
        padding: 7px 11px;
        font-size: 0.82rem;
    }

    .template-library-card {
        min-height: 0;
    }
}


/* =========================================================
   ЦЕНТРИРОВАНИЕ ВЕРХА КАРТОЧЕК
   ========================================================= */

.template-library-card__top {
    justify-content: center;
    position: relative;
}

    .template-library-card__top .template-badge {
        position: absolute;
        right: 0;
        top: 0;
    }

.template-library-card__body {
    text-align: left;
}

    .template-library-card__body .template-category,
    .template-library-card__body h2 {
        text-align: center;
    }

    .template-library-card__body .template-category {
        margin-top: 2px;
    }



/* =========================================================
   ПРИМЕЧАНИЕ О ПОПОЛНЕНИИ БИБЛИОТЕКИ
   ========================================================= */

.templates-growth-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 16px;
    color: #46576B;
    font-size: 0.9rem;
    line-height: 1.4;
}

    .templates-growth-note i {
        flex: 0 0 auto;
        color: #2B579A;
    }

    .templates-growth-note strong {
        color: #303947;
    }

.templates-download-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 10px 14px;
    color: #5f6b7a;
    font-size: 14px;
    line-height: 1.45;
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
}

    .templates-download-note i {
        flex: 0 0 auto;
        color: #2b579a;
        font-size: 15px;
    }

    .templates-download-note strong {
        color: #374151;
        font-weight: 600;
    }
