@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Lalezar";
    src: url("../fonts/Lalezar-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --background: #f3f6fa;
    --surface: #ffffff;
    --text: #183247;
    --muted: #607487;
    --border: #dfe7ef;
    --primary: #123f56;
    --bale: #08766d;
    --eitaa: #a6480b;
    --radius: 22px;
    --shadow: 0 8px 26px rgba(25, 54, 78, .055);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.9;
    -webkit-text-size-adjust: 100%;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid #438cc5;
    outline-offset: 4px;
}

.directory {
    width: min(1180px, 100%);
    margin-inline: auto;
    padding: 16px 14px 32px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 26px 22px;
    border-radius: 26px;
    background: linear-gradient(125deg, #123f56, #176b75);
    color: #fff;
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    inset-inline-end: -90px;
    top: -90px;
    border: 35px solid rgba(255, 255, 255, .055);
    border-radius: 50%;
    pointer-events: none;
}

.hero-label {
    display: inline-block;
    font-size: 12px;
    color: #d8edf0;
}

.hero h1 {
    position: relative;
    margin: 10px 0;
    font-family: "Lalezar", "Vazirmatn", sans-serif;
    font-weight: 400;
    font-size: clamp(27px, 5vw, 39px);
    line-height: 1.6;
}

.hero p {
    max-width: 720px;
    margin: 0;
    color: #e1eff2;
    font-size: 14px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.hero-stats > span {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    font-size: 12px;
}

.hero-stats strong {
    margin-inline-end: 5px;
    font-size: 16px;
}

.tools {
    margin-block: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 13px;
}

.search-row {
    position: relative;
}

.search-row input {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    padding-inline-end: 46px;
    border: 1px solid #ccd9e4;
    border-radius: 13px;
    background: #f8fafc;
    color: var(--text);
    font-size: 16px;
}

.search-row input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-row input::placeholder {
    color: #718294;
    font-size: 13px;
}

.clear-button {
    position: absolute;
    inset-inline-end: 3px;
    top: 3px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 13px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.filter-button {
    min-height: 44px;
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
}

.filter-button[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.result-count {
    color: var(--muted);
    font-size: 12px;
}

.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 20px;
}

.center-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.center-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fff, #f5f9fc);
}

.center-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #e9f1f7;
    color: var(--primary);
    font-size: 27px;
}

.center-heading {
    min-width: 0;
}

.center-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.center-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.channel-list {
    list-style: none;
    margin: 0;
    padding: 5px 17px;
}

.channel-item {
    padding: 16px 0;
}

.channel-item + .channel-item {
    border-top: 1px dashed var(--border);
}

.channel-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.messenger-mark {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-family: "Lalezar", sans-serif;
    font-size: 23px;
}

.messenger-mark.bale {
    background: #e2f4ef;
    color: var(--bale);
}

.messenger-mark.eitaa {
    background: #fff0e3;
    color: var(--eitaa);
}

.channel-text {
    min-width: 0;
}

.platform-name {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.channel-text h3 {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.channel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.join-button,
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 11px;
    font-size: 12px;
}

.join-button {
    flex: 1 1 150px;
    color: #fff;
}

.join-button.bale {
    background: var(--bale);
}

.join-button.eitaa {
    background: var(--eitaa);
}

.copy-button {
    flex: 0 1 auto;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.message-box {
    margin-top: 20px;
    padding: 26px 18px;
    border: 1px dashed #bfcedb;
    border-radius: var(--radius);
    background: #fff;
    text-align: center;
}

.message-box h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.message-box p {
    margin: 0;
    color: var(--muted);
}

.page-footer {
    margin-top: 25px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}

.page-footer p {
    margin: 3px 0;
}

.toast {
    position: fixed;
    z-index: 100;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 50%;
    width: max-content;
    max-width: calc(100% - 28px);
    padding: 11px 18px;
    border-radius: 13px;
    background: #173346;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 680px) {
    .directory {
        padding: 25px 22px 40px;
    }

    .hero {
        padding: 34px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (min-width: 1050px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (hover: hover) {
    .join-button:hover {
        filter: brightness(.92);
    }

    .copy-button:hover,
    .clear-button:hover {
        background: #f1f5f9;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}