/**
 * Mesi Sponsor Manager - Scaled Visual Hierarchy & Flexbox Centering CSS
 */

.mesi-sponsors-container {
    width: 100%;
    margin: 30px 0;
}

.mesi-sponsor-section {
    margin-bottom: 45px;
}

.mesi-sponsor-section:last-child {
    margin-bottom: 0;
}

/* Category Header Styling */
.sponsor-category-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.category-title {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    line-height: 1.3;
    text-align: center;
}

.category-divider {
    height: 3px;
    width: 60px;
    margin: 0 auto;
    border-radius: 2px;
}

/* Updating Status Text (Plain text, centered) */
.sponsor-updating-box {
    text-align: center;
    margin: 12px 0 20px 0;
}

.sponsor-updating-text {
    font-size: 14px;
    font-style: italic;
    color: #64748b;
}

/* ==========================================================================
   Tier Specific Layout Scaling (To đến Nhỏ)
   ========================================================================== */

/* 1. KIM CƯƠNG (DIAMOND) - KHUNG CỰC LỚN (LARGEST) */
.tier-kim-cuong .category-title {
    font-size: 25px;
    color: #1e1b4b;
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tier-kim-cuong .category-divider {
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
    width: 80px;
    height: 4px;
}

.tier-kim-cuong .sponsor-card {
    min-height: 145px;
    padding: 22px;
    border: 2px solid #c7d2fe;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
    border-radius: 16px;
}

.tier-kim-cuong .sponsor-card:hover {
    border-color: #6366f1;
    box-shadow: 0 14px 28px -6px rgba(99, 102, 241, 0.25);
}

.tier-kim-cuong .sponsor-logo-wrapper {
    height: 125px; /* Logo Kim Cương cực to */
}

/* 2. VÀNG (GOLD) - KHUNG LỚN (MEDIUM-LARGE) */
.tier-vang .category-title {
    font-size: 22px;
    color: #78350f;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tier-vang .category-divider {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    width: 65px;
}

.tier-vang .sponsor-card {
    min-height: 110px;
    padding: 16px;
    border: 1.5px solid #fde68a;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.08);
    border-radius: 14px;
}

.tier-vang .sponsor-card:hover {
    border-color: #d97706;
    box-shadow: 0 10px 20px -5px rgba(217, 119, 6, 0.2);
}

.tier-vang .sponsor-logo-wrapper {
    height: 85px; /* Logo Vàng lớn */
}

/* 3. BẠC (SILVER) - KHUNG VỪA (MEDIUM) */
.tier-bac .category-title {
    font-size: 20px;
    color: #334155;
}

.tier-bac .category-divider {
    background: #94a3b8;
    width: 50px;
}

.tier-bac .sponsor-card {
    min-height: 85px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tier-bac .sponsor-logo-wrapper {
    height: 65px; /* Logo Bạc vừa */
}

/* 4. ĐỒNG (BRONZE) - KHUNG NHỎ (SMALL) */
.tier-dong .category-title {
    font-size: 18px;
    color: #7c2d12;
}

.tier-dong .category-divider {
    background: #c2410c;
    width: 40px;
}

.tier-dong .sponsor-card {
    min-height: 70px;
    padding: 8px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
}

.tier-dong .sponsor-logo-wrapper {
    height: 50px; /* Logo Đồng nhỏ gọn */
}

/* ==========================================================================
   Flexbox Centering Grid Layout (Gom & Căn Giữa Hàng Logo 100%)
   ========================================================================== */
.mesi-sponsors-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Item Widths Centered per Column Count */
.columns-1 .mesi-sponsor-item { width: 100%; max-width: 400px; }
.columns-2 .mesi-sponsor-item { width: calc(50% - 10px); max-width: 360px; }
.columns-3 .mesi-sponsor-item { width: calc(33.333% - 12px); max-width: 320px; }
.columns-4 .mesi-sponsor-item { width: calc(25% - 13px); max-width: 260px; }
.columns-5 .mesi-sponsor-item { width: calc(20% - 14px); max-width: 220px; }
.columns-6 .mesi-sponsor-item { width: calc(16.666% - 14px); max-width: 180px; }

/* Sponsor Card Base Styles */
.mesi-sponsor-item {
    box-sizing: border-box;
}

.sponsor-card {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

a.sponsor-card:hover {
    transform: translateY(-4px);
}

/* Căn giữa ảnh tuyệt đối */
.sponsor-logo-wrapper {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.sponsor-logo-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    display: block !important;
    transition: transform 0.3s ease;
}

a.sponsor-card:hover .sponsor-logo-img {
    transform: scale(1.05);
}

.sponsor-title-text {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

.sponsor-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* ==========================================================================
   Responsive Media Queries (Tối ưu hóa Mobile & Tablet)
   ========================================================================== */
@media (max-width: 991px) {
    .tier-kim-cuong .category-title { font-size: 21px; }
    .tier-vang .category-title { font-size: 19px; }
    .tier-bac .category-title { font-size: 18px; }
    .tier-dong .category-title { font-size: 16px; }

    .tier-kim-cuong .sponsor-logo-wrapper { height: 95px; }
    .tier-vang .sponsor-logo-wrapper { height: 75px; }
    .tier-bac .sponsor-logo-wrapper { height: 55px; }
    .tier-dong .sponsor-logo-wrapper { height: 45px; }

    .columns-3 .mesi-sponsor-item,
    .columns-4 .mesi-sponsor-item,
    .columns-5 .mesi-sponsor-item,
    .columns-6 .mesi-sponsor-item {
        width: calc(33.333% - 12px) !important;
        max-width: 100% !important;
    }
}

@media (max-width: 767px) {
    .sponsor-category-header {
        margin-bottom: 18px !important;
    }

    .tier-kim-cuong .category-title { font-size: 18px !important; }
    .tier-vang .category-title { font-size: 17px !important; }
    .tier-bac .category-title { font-size: 16px !important; }
    .tier-dong .category-title { font-size: 15px !important; }

    .mesi-sponsors-grid {
        gap: 12px !important;
    }

    /* Co giãn khung Card trên Mobile */
    .tier-kim-cuong .sponsor-card { min-height: 105px !important; padding: 14px !important; }
    .tier-vang .sponsor-card { min-height: 85px !important; padding: 12px !important; }
    .tier-bac .sponsor-card { min-height: 70px !important; padding: 10px !important; }
    .tier-dong .sponsor-card { min-height: 55px !important; padding: 6px !important; }

    /* Co giãn chiều cao Logo trên Mobile */
    .tier-kim-cuong .sponsor-logo-wrapper { height: 80px !important; }
    .tier-vang .sponsor-logo-wrapper { height: 60px !important; }
    .tier-bac .sponsor-logo-wrapper { height: 45px !important; }
    .tier-dong .sponsor-logo-wrapper { height: 35px !important; }

    .columns-3 .mesi-sponsor-item,
    .columns-4 .mesi-sponsor-item,
    .columns-5 .mesi-sponsor-item,
    .columns-6 .mesi-sponsor-item {
        width: calc(50% - 8px) !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .tier-kim-cuong .sponsor-card { min-height: 95px !important; padding: 10px !important; }
    .tier-vang .sponsor-card { min-height: 75px !important; padding: 8px !important; }
    .tier-bac .sponsor-card { min-height: 65px !important; padding: 6px !important; }
    .tier-dong .sponsor-card { min-height: 50px !important; padding: 5px !important; }

    .tier-kim-cuong .sponsor-logo-wrapper { height: 70px !important; }
    .tier-vang .sponsor-logo-wrapper { height: 55px !important; }
    .tier-bac .sponsor-logo-wrapper { height: 40px !important; }
    .tier-dong .sponsor-logo-wrapper { height: 32px !important; }
}
