/* ================================================================
 * TSV — Community / Magic UI Style Infinite Marquee
 * Yii 1.1 view ile birlikte kullanılmak üzere
 * ================================================================ */

/* ---------- Design tokens ---------- */

.tsv-community {
    --tsv-navy: #15355c;
    --tsv-navy-dark: #0f2746;
    --tsv-blue: #2563a8;
    --tsv-red: #b8392a;
    --tsv-amber: #f59e0b;
    --tsv-emerald: #047857;
    --tsv-violet: #7c3aed;

    --tsv-bg: #f3f5f9;
    --tsv-white: #ffffff;
    --tsv-line: #e6eaf0;
    --tsv-line-strong: #d3dae5;

    --tsv-ink: #1c2434;
    --tsv-ink-2: #5a6478;
    --tsv-ink-3: #8a93a6;

    --badge-complaint: #b8392a;
    --badge-request: #2563a8;
    --badge-suggestion: #7c3aed;
    --badge-thanks: #047857;
    --badge-review: #5a6478;

    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 88px 0 92px;
    background: var(--tsv-bg);

    /*
     * Marquee rail'leri max-content olduğu için section seviyesinde de
     * yatay taşmayı kesiyoruz. Body'ye overflow-x:hidden vermeye gerek yok.
     */
    overflow: hidden;
}

/* ---------- Header container ---------- */

.tsv-community-head-wrap,
.tsv-community-bottom-wrap {
    max-width: 1280px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
}

/* ---------- Header ---------- */

.tsv-community-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px 60px;
    margin-bottom: 24px;
}

.tsv-community-head__intro {
    max-width: 640px;
}

.tsv-community-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;

    color: var(--tsv-red);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.tsv-community-eyebrow__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--tsv-red);
    box-shadow: 0 0 0 4px rgba(184, 57, 42, .12);
    animation: tsv-community-pulse 2.2s ease-in-out infinite;
}

.tsv-community-head__intro h2 {
    margin: 0 0 14px;
    color: var(--tsv-navy);
    font-size: 36px !important;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.022em;
}

.tsv-community-head__intro h2 em {
    color: var(--tsv-red);
    font-style: italic;
    font-weight: 700;
}

.tsv-community-sub {
    max-width: 540px;
    margin: 0;
    color: var(--tsv-ink-2);
    font-size: 16px;
    line-height: 1.55;
}

/* ---------- Header right ---------- */

.tsv-community-head__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.tsv-community-pulse {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 8px 16px 8px 12px;
    border: 1px solid var(--tsv-line);
    border-radius: 999px;
    background: var(--tsv-white);
    box-shadow: 0 2px 8px rgba(21, 53, 92, .04);
}

.tsv-community-pulse__indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.tsv-community-pulse__indicator::before {
    position: relative;
    z-index: 2;

    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tsv-emerald);

    content: "";
}

.tsv-community-pulse__indicator span {
    position: absolute;
    inset: 0;

    border-radius: 50%;
    background: var(--tsv-emerald);
    opacity: 0;

    animation: tsv-community-pulse-ring 2s ease-out infinite;
}

.tsv-community-pulse__indicator span:nth-child(2) {
    animation-delay: .7s;
}

.tsv-community-pulse__indicator span:nth-child(3) {
    animation-delay: 1.4s;
}

.tsv-community-pulse__text {
    color: var(--tsv-ink-2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.tsv-community-pulse__text strong {
    margin-right: 2px;
    color: var(--tsv-navy);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- Header CTA ---------- */

.tsv-community-head__actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tsv-community-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 13px 22px;
    border-radius: 8px;
    background: var(--tsv-navy);
    color: #fff !important;

    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;

    box-shadow: 0 4px 14px rgba(21, 53, 92, .18);
    transition:
        transform .25s cubic-bezier(.4, 0, .2, 1),
        background-color .25s ease,
        box-shadow .25s ease;
}

.tsv-community-cta-primary:hover,
.tsv-community-cta-primary:focus-visible {
    background: var(--tsv-red);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(184, 57, 42, .24);
}

.tsv-community-cta-primary i {
    transition: transform .25s ease;
}

.tsv-community-cta-primary:hover i,
.tsv-community-cta-primary:focus-visible i {
    transform: translateX(4px);
}

.tsv-community-cta-link {
    position: relative;
    display: inline-flex;
    align-items: center;

    padding: 4px 0;
    color: var(--tsv-navy) !important;

    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none !important;
}

.tsv-community-cta-link::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 1.5px;
    background: currentColor;

    content: "";
    transform: scaleX(.4);
    transform-origin: left;
    transition: transform .25s ease;
}

.tsv-community-cta-link:hover,
.tsv-community-cta-link:focus-visible {
    color: var(--tsv-red) !important;
}

.tsv-community-cta-link:hover::after,
.tsv-community-cta-link:focus-visible::after {
    transform: scaleX(1);
}

/* ---------- Filters ---------- */

.tsv-community-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 28px 0 30px;
}

.tsv-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 36px;
    padding: 8px 14px;

    border: 1px solid var(--tsv-line);
    border-radius: 999px;
    background: var(--tsv-white);
    color: var(--tsv-ink-2);

    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    appearance: none;

    transition:
        transform .2s ease,
        color .2s ease,
        border-color .2s ease,
        background-color .2s ease,
        box-shadow .2s ease;
}

.tsv-filter-chip em {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--tsv-bg);
    color: var(--tsv-ink-3);

    font-size: 11.5px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;

    transition:
        color .2s ease,
        background-color .2s ease;
}

.tsv-filter-chip:hover {
    border-color: var(--tsv-navy);
    color: var(--tsv-navy);
    transform: translateY(-1px);
}

.tsv-filter-chip:hover em {
    background: rgba(21, 53, 92, .08);
    color: var(--tsv-navy);
}

.tsv-filter-chip.is-active,
.tsv-filter-chip[aria-pressed="true"] {
    border-color: var(--tsv-navy);
    background: var(--tsv-navy);
    color: #fff;
    box-shadow: 0 4px 14px rgba(21, 53, 92, .18);
}

.tsv-filter-chip.is-active em,
.tsv-filter-chip[aria-pressed="true"] em {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.tsv-filter-chip__dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--tsv-ink-3);
}

.tsv-filter-chip__dot--complaint {
    background: var(--badge-complaint);
}

.tsv-filter-chip__dot--request {
    background: var(--badge-request);
}

.tsv-filter-chip__dot--suggestion {
    background: var(--badge-suggestion);
}

.tsv-filter-chip__dot--thanks {
    background: var(--badge-thanks);
}

/* ================================================================
 * Marquee
 * ================================================================ */

.tsv-community-marquee {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    isolation: isolate;
}

/*
 * overflow:hidden kullanıyoruz fakat kart hover gölgesinin kesilmemesi için
 * wrapper'a dikey güvenli alan bırakıyoruz.
 */
.tsv-community-rail-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;

    padding: 22px 0 26px;
    margin: -12px 0 -6px;
}

.tsv-community-rail-wrap + .tsv-community-rail-wrap {
    margin-top: 8px;
}

.tsv-community-rail-wrap.is-empty {
    display: none;
}

.tsv-community-rail {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    gap: 20px;

    width: max-content;
    min-width: max-content;
    padding: 0;

    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);

    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;

    /*
     * Dikey sayfa scroll'u çalışmaya devam eder,
     * yatay hareketi JS yönetir.
     */
    touch-action: pan-y;
}

.tsv-community-rail.is-dragging {
    cursor: grabbing;
}

/*
 * Az sayıda kart kaldığında marquee yerine statik ve ortalı gösterim.
 * JS bu class'ı otomatik yönetir.
 */
.tsv-community-rail.is-static {
    width: 100%;
    min-width: 100%;
    justify-content: center;
    transform: translate3d(0, 0, 0) !important;
    cursor: default;
}

/* ---------- Card ---------- */

.tsv-community-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 340px;
    max-width: 540px;
    padding: 20px 22px 18px;
    border: 1px solid var(--tsv-line);
    border-radius: 14px;
    background: var(--tsv-white);
    color: inherit;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 39, 70, .015);
    transition:
        transform .35s cubic-bezier(.34, 1.2, .64, 1),
        box-shadow .35s cubic-bezier(.4, 0, .2, 1),
        border-color .25s ease;
}

.tsv-community-card:hover,
.tsv-community-card:focus-visible {
    z-index: 3;
    border-color: rgba(21, 53, 92, .72);
    color: inherit;
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(21, 53, 92, .12),
        0 4px 12px rgba(21, 53, 92, .05);
}

.tsv-community-card:visited {
    color: inherit;
}

/*
 * JS'nin oluşturduğu duplicate kartlar görünürdür fakat klavye tab sırasına
 * alınmaz; JS tabindex=-1 ve aria-hidden=true atar.
 */
.tsv-community-card--duplicate {
    pointer-events: auto;
}

.tsv-community-card.tsv-is-hidden {
    display: none !important;
}

/* ---------- Card top ---------- */

.tsv-community-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    min-height: 28px;
    margin-bottom: 14px;
}

.tsv-community-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 10px;
    border: 1px solid var(--badge-color, var(--tsv-navy));
    border-radius: 6px;
    background: #fff;
    color: var(--badge-color, var(--tsv-navy));

    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    white-space: nowrap;
}

.tsv-community-card__badge i {
    font-size: 10px;
}

.tsv-community-card__time {
    color: var(--tsv-ink-3);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tsv-community-card--complaint .tsv-community-card__badge {
    --badge-color: var(--badge-complaint);
}

.tsv-community-card--request .tsv-community-card__badge {
    --badge-color: var(--badge-request);
}

.tsv-community-card--suggestion .tsv-community-card__badge {
    --badge-color: var(--badge-suggestion);
}

.tsv-community-card--thanks .tsv-community-card__badge {
    --badge-color: var(--badge-thanks);
}

.tsv-community-card--review .tsv-community-card__badge {
    --badge-color: var(--badge-review);
}

/* ---------- Author ---------- */

.tsv-community-card__author {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 14px;
}

.tsv-community-card__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    border-radius: 50%;
    background: var(--tsv-navy);
    color: #fff;

    object-fit: cover;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.tsv-community-card__avatar--initial {
    text-transform: uppercase;
}

.tsv-community-card__meta {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.tsv-community-card__name {
    overflow: hidden;

    color: var(--tsv-ink);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsv-community-card__company {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-width: 0;
    overflow: hidden;

    color: var(--tsv-blue);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsv-community-card__company i {
    flex: 0 0 auto;
    font-size: 9px;
    opacity: .85;
}

/* ---------- Title ---------- */

.tsv-community-card__title {
    display: -webkit-box;
    overflow: hidden;
    max-height: 50px;
    margin: 0;
    color: var(--tsv-navy);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.38;
    letter-spacing: -.015em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    transition: color .25s ease;
    font-size: 14pt!important;
}

/* ---------- Rating ---------- */

.tsv-community-card__rating {
    display: flex;
    gap: 2px;
    margin: 10px 0px;
}

.tsv-community-card__rating i {
    color: var(--tsv-line-strong);
    font-size: 12.5px;

    transition:
        color .2s ease,
        transform .2s ease;
}

.tsv-community-card__rating i.is-filled {
    color: var(--tsv-amber);
}

.tsv-community-card:hover .tsv-community-card__rating i.is-filled {
    transform: scale(1.12);
}

/* ---------- Footer ---------- */

.tsv-community-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: auto;
    padding-top: 14px;

    border-top: 1px solid var(--tsv-line);
}

.tsv-community-card__views {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: var(--tsv-ink-3);
    font-size: 12px;
    font-weight: 500;
}

.tsv-community-card__views i {
    font-size: 12px;
    opacity: .85;
}

.tsv-community-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    color: var(--tsv-navy);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;

    transition: gap .25s ease;
}

.tsv-community-card__cta i {
    transition: transform .25s ease;
}

.tsv-community-card:hover .tsv-community-card__cta,
.tsv-community-card:focus-visible .tsv-community-card__cta {
    gap: 8px;
}

.tsv-community-card:hover .tsv-community-card__cta i,
.tsv-community-card:focus-visible .tsv-community-card__cta i {
    transform: translateX(3px);
}

/* ---------- Empty ---------- */

.tsv-community-empty {
    padding: 48px 20px 18px;
    color: var(--tsv-ink-3);
    text-align: center;
}

.tsv-community-empty[hidden] {
    display: none !important;
}

.tsv-community-empty i {
    margin-bottom: 12px;
    font-size: 32px;
    opacity: .45;
}

.tsv-community-empty p {
    margin: 0;
    font-size: 15px;
}

/* ---------- Bottom CTA ---------- */

.tsv-community-more-wrap {
    margin-top: 36px;
    text-align: center;
}

.tsv-community-more__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 13px 26px;

    border: 1.5px solid var(--tsv-line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--tsv-navy) !important;

    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;

    transition:
        transform .25s ease,
        color .25s ease,
        background-color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.tsv-community-more__btn:hover,
.tsv-community-more__btn:focus-visible {
    border-color: var(--tsv-navy);
    background: var(--tsv-navy);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(21, 53, 92, .18);
}

.tsv-community-more__btn i {
    transition: transform .25s ease;
}

.tsv-community-more__btn:hover i,
.tsv-community-more__btn:focus-visible i {
    transform: translateX(4px);
}

/* ---------- Focus ---------- */

.tsv-community a:focus-visible,
.tsv-community button:focus-visible {
    outline: 3px solid rgba(37, 99, 168, .28);
    outline-offset: 3px;
}

/* ---------- Animations ---------- */

@keyframes tsv-community-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(184, 57, 42, .12);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(184, 57, 42, 0);
    }
}

@keyframes tsv-community-pulse-ring {
    0% {
        opacity: .7;
        transform: scale(.4);
    }

    100% {
        opacity: 0;
        transform: scale(2.2);
    }
}

/* ================================================================
 * Responsive
 * ================================================================ */

@media (max-width: 1180px) {
    .tsv-community-card {
        flex-basis: 320px;
        width: 320px;
        min-width: 320px;
        max-width: 320px;
    }
}

@media (max-width: 900px) {
    .tsv-community {
        padding: 72px 0 76px;
    }

    .tsv-community-head {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 24px;
    }

    .tsv-community-head__intro h2 {
        font-size: 28px !important;
    }

    .tsv-community-head__aside {
        align-items: flex-start;
    }

    .tsv-community-card {
        flex-basis: 300px;
        width: 300px;
        min-width: 300px;
        max-width: 300px;
        min-height: 296px;
    }

    .tsv-community-card__title {
        font-size: 17px;
    }
}

@media (max-width: 720px) {
    .tsv-community-head-wrap,
    .tsv-community-bottom-wrap {
        padding-right: 18px;
        padding-left: 18px;
    }

    .tsv-community-head__actions {
        width: 100%;
    }

    .tsv-community-cta-primary {
        flex: 1 1 auto;
    }

    .tsv-community-filters {
        flex-wrap: nowrap;
        gap: 8px;

        width: calc(100% + 36px);
        margin-right: -18px;
        margin-left: -18px;
        padding: 6px 18px 10px;

        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .tsv-community-filters::-webkit-scrollbar {
        display: none;
    }

    .tsv-filter-chip {
        flex: 0 0 auto;
    }

    .tsv-community-rail {
        gap: 14px;
    }

    .tsv-community-rail-wrap {
        padding-top: 18px;
        padding-bottom: 22px;
    }
}

@media (max-width: 540px) {
    .tsv-community {
        padding: 56px 0 60px;
    }

    .tsv-community-head__intro h2 {
        font-size: 24px !important;
    }

    .tsv-community-sub {
        font-size: 14px;
    }

    .tsv-community-head__actions {
        align-items: stretch;
        gap: 14px;
    }

    .tsv-community-cta-primary {
        padding-right: 16px;
        padding-left: 16px;
        font-size: 13.5px;
    }

    .tsv-community-cta-link {
        align-self: center;
        font-size: 13.5px;
    }

    .tsv-community-pulse {
        padding: 6px 14px 6px 10px;
    }

    .tsv-community-card {
        flex-basis: min(280px, calc(100vw - 44px));
        width: min(280px, calc(100vw - 44px));
        min-width: min(280px, calc(100vw - 44px));
        max-width: min(280px, calc(100vw - 44px));

        min-height: 286px;
        padding: 18px 18px 16px;
    }

    .tsv-community-card__title {
        font-size: 16px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .tsv-community-eyebrow__dot,
    .tsv-community-pulse__indicator span {
        animation: none !important;
    }

    .tsv-community-rail {
        transform: none !important;
    }

    .tsv-community-card,
    .tsv-community-card__rating i,
    .tsv-community-card__cta,
    .tsv-community-card__cta i {
        transition: none !important;
    }
}
