/* ══════════════════════════════════════════
   TEMPLATES PAGE
   ══════════════════════════════════════════ */

.tpl-hero {
    padding: 140px 24px 56px;
    text-align: center;
    background: linear-gradient(135deg, #EEF2FF 0%, #F5F0FF 50%, #FFF7ED 100%);
    position: relative;
    overflow: hidden;
}

.tpl-hero::before,
.tpl-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.tpl-hero::before {
    width: 480px;
    height: 480px;
    background: rgba(26, 110, 245, .06);
    top: -140px;
    right: -100px;
}

.tpl-hero::after {
    width: 380px;
    height: 380px;
    background: rgba(124, 58, 237, .05);
    bottom: -120px;
    left: -80px;
}

.tpl-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.tpl-hero .pill {
    margin-bottom: 18px;
}

.tpl-hero h1 {
    font-size: clamp(32px, 5vw, 50px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1.4px;
    margin-bottom: 16px;
    color: var(--text);
}

.tpl-hero h1 .ac {
    color: var(--blue);
}

.tpl-hero p {
    font-size: 17px;
    color: var(--text2);
    line-height: 1.75;
    margin: 0 auto;
    max-width: 560px;
}

.tpl-toolbar {
    max-width: 1120px;
    margin: -28px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 5;
}

.tpl-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.tpl-search {
    flex: 1 1 220px;
    min-width: 0;
}

.tpl-search input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #f8fafc;
}

.tpl-search input:focus {
    border-color: var(--blue);
    background: #fff;
}

.tpl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tpl-chip {
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text2);
    border-radius: 100px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    width: auto;
}

.tpl-chip.active,
.tpl-chip:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}

.tpl-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--text3);
    white-space: nowrap;
}

.tpl-section {
    padding: 40px 24px 80px;
}

.tpl-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.tpl-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tpl-live-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}

.tpl-live-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    min-width: 0;
}

.tpl-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: #ecfdf5;
    color: #047857;
    border-radius: 100px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.tpl-live-frame {
    height: 520px;
    background: #f4f7fc;
    flex-shrink: 0;
}

.tpl-live-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.tpl-card-body {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    flex: 1 1 auto;
}

.tpl-card-body p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--text2);
    line-height: 1.65;
    flex: 1 1 auto;
}

.tpl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.tpl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    width: auto;
}

.tpl-btn-primary {
    background: var(--blue);
    color: #fff;
}

.tpl-btn-primary:hover {
    color: #fff;
    background: var(--blue2);
}

.tpl-btn-ghost {
    background: var(--blue-light);
    color: var(--blue);
}

.tpl-btn-ghost:hover {
    color: var(--blue2);
}

.tpl-empty {
    display: none;
    max-width: 1120px;
    margin: 24px auto 0;
    text-align: center;
    color: var(--text3);
    font-size: 15px;
}

.tpl-card.is-hidden {
    display: none;
}

@media (max-width: 991px) {
    .tpl-grid {
        grid-template-columns: 1fr;
    }

    .tpl-live-frame {
        height: 480px;
    }
}

@media (max-width: 767px) {
    .tpl-hero {
        padding: 112px 16px 44px;
    }

    .tpl-hero h1 {
        font-size: clamp(28px, 8vw, 36px);
        letter-spacing: -0.8px;
    }

    .tpl-hero p {
        font-size: 15px;
    }

    .tpl-toolbar {
        margin-top: -20px;
        padding: 0 16px;
    }

    .tpl-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .tpl-count {
        margin-left: 0;
    }

    .tpl-section {
        padding: 28px 16px 56px;
    }

    .tpl-grid {
        gap: 16px;
    }

    .tpl-live-bar {
        min-height: 52px;
        padding: 10px 14px;
    }

    .tpl-live-title {
        font-size: 14px;
    }

    .tpl-live-frame {
        height: 420px;
    }

    .tpl-card-body {
        padding: 14px 16px 16px;
    }

    .tpl-btn {
        width: 100%;
    }
}
