/* ============================================================
 * footer.css — FOOTER (tông "Tím brand hiện đại"), bố cục centered.
 * File độc lập, KHÔNG qua build; nạp async (dưới màn -> không chặn render).
 * Markup: resources/views/users/layout/footer.blade.php
 * ============================================================ */

:root {
    --ft-bg1: #1d1a27;
    --ft-bg2: #131120;
    --ft-bar: #0f0d17;
    --ft-text: #b8b3c7;
    --ft-heading: #ffffff;
    --ft-muted: #8b869b;
    --ft-accent: #a855f7;
    --ft-accent-2: #7c3aed;
    --ft-border: rgba(255, 255, 255, 0.08);
}

.footer {
    position: relative;
    background:
        radial-gradient(1200px 300px at 50% 0%, rgba(124, 58, 237, 0.16), transparent 70%),
        linear-gradient(180deg, var(--ft-bg1) 0%, var(--ft-bg2) 100%);
    color: var(--ft-text);
    font-size: 14px;
    line-height: 1.7;
    overflow: hidden;
    padding-top: 30px;
}
/* Viền trên gradient tím */
.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ft-accent-2), var(--ft-accent), var(--ft-accent-2));
}

.footer-inner {
    max-width: 100%;
    text-align: center;
}

/* ---- Logo ---- */
.footer-logo-wrap { display: flex; justify-content: center; align-items: center; margin-bottom: 30px; }
.footer-logo-wrap a{
    display: block;
        width: 150px;
    aspect-ratio: 150 / 30;
    height: auto;
}
.footer-logo-wrap img {
    width: 150px;           /* = kích thước gốc 150x30 (srcset lo 2x/3x cho màn retina) */
    aspect-ratio: 150/30;
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 4px 14px rgba(124, 58, 237, 0.35));
    transition: transform 0.2s ease;
}
.footer-logo-wrap a:hover img { transform: translateY(-2px); }

/* ---- Section chung + tiêu đề canh giữa ---- */
.footer-section { margin-bottom: 30px; }
.footer h4 {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-bottom: 12px;
    color: var(--ft-heading);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.3px;
}
.footer h4::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ft-accent-2), var(--ft-accent));
}

/* ---- Nhà tài trợ (sponsor cards) ---- */
.ads-sponsors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
}
.ads-sponsor-item {
    position: relative;     /* neo cho khối ad (ins) đặt tuyệt đối -> ra khỏi flow -> không gây CLS */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    /* KÍCH THƯỚC CỐ ĐỊNH -> card không đổi size khi ad tải -> tránh CLS */
    width: 140px;
    height: 58px;
    padding: 8px 14px;
    overflow: hidden;
    /* Cô lập tuyệt đối: size+layout+paint của card KHÔNG phụ thuộc nội dung -> Revive bơm gì
       cũng không đổi cỡ card, không lan shift ra ngoài (CLS). */
    contain: strict;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ft-border);
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.ads-sponsor-item:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.22);
}
/* CLS=0 khi giữ Revive (điền logo phía client): làm card CỨNG TUYỆT ĐỐI.
   MỌI con trực tiếp của card (Revive có thể bơm <ins>, <iframe>, <a>, <div>, hay thay hẳn thẻ)
   đều đặt position:absolute phủ kín card cố định -> RA KHỎI FLOW. Dù ad tải muộn / sai cỡ /
   "unsized" cũng KHÔNG thể đổi kích thước card hay đẩy phần tử nào bên dưới -> CLS = 0.
   Card đã overflow:hidden nên phần tràn bị cắt. !important để thắng inline style Revive gắn muộn. */
.ads-sponsor-item > * {
    position: absolute !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.ads-sponsor-item ins > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}
.ads-sponsor-item img,
.ads-sponsor-item a img {
    height: 45px;
    width: auto;
    max-width: 100%;       /* gọn trong card; ins tuyệt đối nên không gây shift */
    max-height: 100%;
    display: block;
    object-fit: contain;
}
/* Card tài trợ rỗng -> hiện icon placeholder mờ (ảnh chưa có).
   Dùng cả :has (hiện ngay khi ins rỗng) lẫn class .ads-sponsor-empty (JS fallback) */
.ads-sponsor-item.ads-sponsor-empty,
.ads-sponsor-item:has(> ins:empty) {
    background: rgba(255, 255, 255, 0.02);
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
}
.ads-sponsor-item.ads-sponsor-empty:hover,
.ads-sponsor-item:has(> ins:empty):hover {
    background: rgba(255, 255, 255, 0.03);
    transform: none;
    box-shadow: none;
}
.ads-sponsor-item.ads-sponsor-empty::before,
.ads-sponsor-item:has(> ins:empty)::before {
    content: "";
    width: 26px;
    height: 26px;
    opacity: 0.4;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b869b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E");
}

/* ---- Social ---- */
.footer-html {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}
.footer-html a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ft-border);
    color: var(--ft-text);
    font-size: 18px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.footer-html a:hover {
    background: linear-gradient(120deg, var(--ft-accent-2), var(--ft-accent));
    color: #fff;
    transform: translateY(-2px);
}
.footer-html img { max-width: 100%; height: auto; }
/* Social trống -> các nút placeholder nét đứt + icon web mờ */
.footer-html-empty {
    margin-top: 15px;
    pointer-events: none;
}
.social-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.14);
}
.social-placeholder::before {
    content: "";
    width: 20px;
    height: 20px;
    opacity: 0.4;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b869b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

/* ---- Từ khóa (pills) ---- */
.footer-keywords ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.footer-keywords ul li { margin: 0; }
.footer-keywords ul li a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ft-border);
    color: var(--ft-text);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.footer-keywords ul li a:hover {
    background: linear-gradient(120deg, var(--ft-accent-2), var(--ft-accent));
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
}

/* ---- Mô tả ---- */
.footer-description {
    margin-top: 30px;
    margin-bottom: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--ft-border);
}
.footer-description p {
    margin: 0 auto;
    max-width: 900px;
    color: var(--ft-muted);
    font-size: 13.5px;
    line-height: 1.85;
}

/* ---- Link chung + focus ---- */
.footer a { color: var(--ft-text); transition: color 0.2s ease; }
.footer a:hover,
.footer a:focus { color: var(--ft-accent); text-decoration: none; }
.footer a:focus-visible {
    outline: 2px solid var(--ft-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- Copyright bar full-width ---- */
.footer-copyright {
    padding: 18px 0;
    text-align: center;
    color: var(--ft-muted);
    font-size: 13px;
    background: var(--ft-bar);
    border-top: 1px solid var(--ft-border);
}
.footer-copyright a { color: var(--ft-accent); }

/* ============================================================
 * Responsive
 * ============================================================ */
/* Tablet */
@media (max-width: 991px) {
    .footer-inner { padding-left: 16px; padding-right: 16px; }
    .footer-copyright { padding-left: 16px; padding-right: 16px; }
}

/* Mobile */
@media (max-width: 767px) {
    .footer-inner {  }
    .footer-logo-wrap { margin-bottom: 24px; }
    .footer-logo-wrap img { width: 140px; }
    .footer-section { margin-bottom: 24px; }
    .footer h4 { font-size: 16px; margin-bottom: 16px; }
    .ads-sponsors { gap: 10px; }
    .ads-sponsor-item { min-width: 78px; height: 48px; padding: 6px 10px; }
    .ads-sponsor-item img,
    .ads-sponsor-item a img { height: 28px; }
    .footer-html { gap: 10px; }
    .footer-html a,
    .social-placeholder { width: 40px; height: 40px; font-size: 17px; }
    .footer-description { margin-top: 24px; padding-top: 20px; }
    .footer-description p { text-align: left; font-size: 13px; line-height: 1.75; }
}

/* Màn nhỏ: sponsor 3 card / hàng */
@media (max-width: 480px) {
    .footer-inner { }
    .footer-logo-wrap img { width: 122px; }
    .ads-sponsors { gap: 8px; }
    .ads-sponsor-item {
        min-width: 0;
        max-width: none;
        flex: 0 0 calc(33.333% - 6px);
        height: 46px;
        padding: 5px 8px;
    }
    .ads-sponsor-item img,
    .ads-sponsor-item a img { height: 26px; max-width: 100%; }
    .footer-keywords ul { gap: 6px; }
    .footer-keywords ul li a { padding: 5px 12px; }
    .footer-html a,
    .social-placeholder { width: 38px; height: 38px; }
}

/* Tôn trọng prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .footer *,
    .footer *::before { transition: none !important; }
}
