/* ============================================================
   Top Ranking Nhà Cái – ranking.css  v1.17.0
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --trn-red:     #b20000;
    --trn-navy:    #1e3a8a;
    --trn-gold:    #f59e0b;
    --trn-orange:  #f97316;
    --trn-green:   #16a34a;
    --trn-gray:    #6b7280;
    --trn-light:   #f9fafb;
    --trn-border:  #e5e7eb;
    --trn-radius:  10px;
    --trn-shadow:  0 0px 15px rgba(0,0,0,0.25);
}

/* ===== Wrapper ===== */
.trn-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
    color: #111827;
}

/* ===== Filter Bar ===== */
.trn-filter-bar {
    background: #fff;
    border: 1px solid var(--trn-border);
    border-radius: var(--trn-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--trn-shadow);
}
.trn-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.trn-filter-group:last-child { margin-bottom: 0; }
.trn-filter-group > label {
    font-size: 12px;
    font-weight: 700;
    color: var(--trn-gray);
    text-transform: uppercase;
    letter-spacing: .5px;
    min-width: 90px;
}
.trn-filter-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.trn-btn-filter {
    padding: 4px 14px;
    border: 1.5px solid var(--trn-border);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .15s;
    line-height: 1.5;
}
.trn-btn-filter:hover { border-color: var(--trn-red); color: var(--trn-red); }
.trn-btn-filter.active {
    background: var(--trn-red);
    border-color: var(--trn-red);
    color: #fff;
}

/* ===== List ===== */
.trn-list { display: flex; flex-direction: column; gap: 30px; }

.row-collapse {
    align-items: center;
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    gap: 2px;
}

/* ===== Card ===== */
.trn-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fff;
    border: 0px solid #ffff;
    border-radius: var(--trn-radius);
    overflow: hidden;
    box-shadow: var(--trn-shadow);
    transition: transform .2s, box-shadow .2s;
    width: 100%;
}
.trn-card--featured {
    border-color: var(--trn-orange);
    border-width: 2px;
}

/* ===== Cột trái: Logo + Medal ===== */
.trn-col-left {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 40%;
    min-width: 180px;
    padding: 14px 14px;
}
.trn-logo {
    width: 33%;
}
.img-trn-logo {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    width: auto;
    height: auto;
}
.trn-logo-placeholder {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--trn-red), var(--trn-orange));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
}

/* Huy chương */
.trn-medal {
    width: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
}
.trn-medal-1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.trn-medal-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.trn-medal-3 { background: linear-gradient(135deg, #b45309, #92400e); }
.trn-medal-n { background: linear-gradient(135deg, #374151, #1f2937); font-size: 13px; }

/* ===== Cột phải: Content + CTA ===== */
.trn-col-right {
    padding: 14px 14px;
    flex: 1 1 0%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
}

/* ===== Vùng nội dung ===== */
.trn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Badge pill */
.trn-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: #fff;
    align-self: flex-start;
    line-height: 1.5;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tên + Sao */
.trn-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.trn-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
}
.trn-stars-row { display: flex; align-items: center; }

/* ===== Stars — chỉ !important đúng chỗ cần thiết ===== */
.trn-stars {
    font-size: 18px;
    letter-spacing: 1px;
    line-height: 1;
}
/* Tăng specificity (2 class) để thắng theme mà không cần !important */
.trn-stars .trn-star-full  { color: var(--trn-gold); }
.trn-stars .trn-star-empty { color: #d1d5db; }
.trn-stars .trn-star-half  {
    display: inline-block;
    background: linear-gradient(to right, var(--trn-gold) 50%, #d1d5db 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bullet features */
.trn-features {
    margin: 0;
    list-style: disc;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.trn-features li {
    font-size: 11px;
    color: #353e4c;
    margin-bottom: 0.5em;
    margin-left: 1.3em;
}

.trn-excerpt {
    font-size: 13px;
    color: var(--trn-gray);
    margin: 0;
    line-height: 1.5;
}

/* ===== Vùng nút CTA ===== */
.trn-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 170px;
    min-width: 152px;
    flex-shrink: 0;
}

.trn-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .4px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    border: none;
    white-space: nowrap;
}
.trn-btn:hover { opacity: .87; transform: scale(1.03); }

.trn-btn--review {
    background: var(--trn-navy);
    color: #fff !important;
}
.trn-btn--cta {
    background: var(--trn-red);
    color: #fff !important;
    animation: trn-pulse 2.4s ease-in-out infinite;
}
@keyframes trn-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(232,0,10,0); }
    50%      { box-shadow: 0 0 0 6px rgba(232,0,10,.22); }
}

/* ===== JS states ===== */
.trn-card.trn-hidden { display: none !important; }
.trn-no-results { text-align: center; padding: 32px; color: var(--trn-gray); font-size: 15px; }

/* ===== Responsive ===== */
@media (max-width: 680px) {
    .trn-col-left {
        width: 160px;
        min-width: 160px;
        padding: 12px 10px;
    }
    .img-trn-logo { max-width: 90px; max-height: 65px; }
    .trn-title { font-size: 17px; }
    .trn-stars { font-size: 15px; }
    .trn-cta-wrap { width: 130px; min-width: 130px; }
    .trn-btn { font-size: 12px; padding: 8px 6px; }
}

@media (max-width: 480px) {
    .trn-card {
        flex-direction: column;
    }

    /* ===== Phần logo / medal ===== */
    .trn-col-left {
        width: 100%;
        min-width: unset;
        padding: 20px 16px 14px;
        border-right: none;
        justify-content: center;
        position: relative;
    }

    /* Row collapse: xếp dọc, căn giữa */
    .row-collapse {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    /* Medal: căn giữa, flow trong row-collapse */
    .trn-medal {
        position: static;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        font-size: 15px;
    }

    /* Logo căn giữa */
    .trn-logo { width: auto; text-align: center; }
    .img-trn-logo { max-width: 130px; max-height: 85px; }

    /* Tên + sao căn giữa */
    .trn-title-row {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .trn-title { font-size: 18px; white-space: normal; text-align: center; }

    /* ===== Phần nội dung ===== */
    .trn-col-right {
        width: 100%;
        flex-direction: column;
        padding: 14px 16px;
    }

    .trn-content { gap: 8px; }

    .trn-badge { align-self: center; }

    .trn-features { padding-left: 0; list-style: none; }
    .trn-features li { margin-left: 0; padding-left: 14px; position: relative; }
    .trn-features li::before { content: "•"; position: absolute; left: 0; color: var(--trn-red); }

    /* ===== Nút CTA: full width, xếp dọc ===== */
    .trn-cta-wrap {
        width: 100%;
        min-width: unset;
        flex-direction: column;
        border-left: none;
        padding: 12px 0 0;
        margin-top: 4px;
    }
    .trn-btn { width: 100%; padding: 11px 10px; font-size: 13px; }
}
