/* Monthly Ticket Leaderboard Custom Styles */

/* Winner Card Styles & Hover offsets */
.winner-hall-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.04) 100%);
    border: 2px solid rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.18), inset 0 0 15px rgba(245, 158, 11, 0.05);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.winner-hall-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.32), inset 0 0 20px rgba(245, 158, 11, 0.1);
}

/* Light Theme override for card */
[data-bs-theme="light"] .winner-hall-card,
.light-theme .winner-hall-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
    border-color: rgba(217, 119, 6, 0.45) !important;
    box-shadow: 0 5px 22px rgba(217, 119, 6, 0.12);
}

[data-bs-theme="light"] .winner-hall-card:hover,
.light-theme .winner-hall-card:hover {
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.22);
}

/* Floating Crown Badge */
.winner-crown-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    padding: 8px 18px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    animation: float-crown 3s ease-in-out infinite;
}

@keyframes float-crown {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* Winner Cover Hover & Glow */
.winner-cover-glow {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(245, 158, 11, 0.25);
    border: 2px solid rgba(245, 158, 11, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-cover-glow:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.55);
}

/* Ranking Item Interactive list styles */
.ranking-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 4px solid transparent !important;
}

.ranking-item:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="light"] .ranking-item:hover,
.light-theme .ranking-item:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

.rank-border-2 { border-left-color: #cbd5e1 !important; } /* Silver rank #2 */
.rank-border-3 { border-left-color: #b45309 !important; } /* Bronze rank #3 */
.rank-border-other { border-left-color: rgba(255, 255, 255, 0.15) !important; }

[data-bs-theme="light"] .rank-border-other,
.light-theme .rank-border-other {
    border-left-color: rgba(0, 0, 0, 0.1) !important;
}

/* Winner Stats Box */
.winner-stats-box {
    background: rgba(0, 0, 0, 0.22);
    border: 1px dashed rgba(245, 158, 11, 0.4);
}
.winner-stats-box .stat-tickets {
    color: #f59e0b !important;
}
.winner-stats-box .stat-xu {
    color: #06b6d4 !important;
}
.winner-stats-box .stat-label {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Custom Ticket Badge with High Contrast in Light Theme */
.badge-custom-ticket {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b !important;
    font-family: var(--bs-font-monospace);
    border-radius: 6px;
    font-weight: 700;
}

/* ==========================================================================
   POWERPOINT-STYLE STAGGERED ENTRANCE ANIMATIONS (Hiệu ứng Trình chiếu)
   ========================================================================== */

@keyframes pptSlideInTop {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pptZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(30px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pptSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.ppt-slide-top {
    animation: pptSlideInTop 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.ppt-zoom-winner {
    animation: pptZoomIn 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s both;
}

.ppt-stagger-item {
    opacity: 0;
    animation: pptSlideInRight 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.ppt-stagger-item:nth-child(1) { animation-delay: 0.25s; }
.ppt-stagger-item:nth-child(2) { animation-delay: 0.33s; }
.ppt-stagger-item:nth-child(3) { animation-delay: 0.41s; }
.ppt-stagger-item:nth-child(4) { animation-delay: 0.49s; }
.ppt-stagger-item:nth-child(5) { animation-delay: 0.57s; }
.ppt-stagger-item:nth-child(6) { animation-delay: 0.65s; }
.ppt-stagger-item:nth-child(7) { animation-delay: 0.73s; }
.ppt-stagger-item:nth-child(8) { animation-delay: 0.81s; }
.ppt-stagger-item:nth-child(9) { animation-delay: 0.89s; }
.ppt-stagger-item:nth-child(10) { animation-delay: 0.97s; }

/* ==========================================================================
   HIGH-CONTRAST LIGHT THEME OVERRIDES
   ========================================================================== */

[data-bs-theme="light"] .text-warning,
.light-theme .text-warning {
    color: #b45309 !important;
}

[data-bs-theme="light"] .btn-outline-warning,
.light-theme .btn-outline-warning {
    color: #b45309 !important;
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.08) !important;
}

[data-bs-theme="light"] .btn-outline-warning:hover,
.light-theme .btn-outline-warning:hover {
    color: #ffffff !important;
    background: #d97706 !important;
    border-color: #d97706 !important;
}

[data-bs-theme="light"] .winner-crown-badge,
.light-theme .winner-crown-badge {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

[data-bs-theme="light"] .winner-stats-box,
.light-theme .winner-stats-box {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px dashed rgba(217, 119, 6, 0.5) !important;
}

[data-bs-theme="light"] .winner-stats-box .stat-tickets,
.light-theme .winner-stats-box .stat-tickets {
    color: #b45309 !important;
}

[data-bs-theme="light"] .winner-stats-box .stat-xu,
.light-theme .winner-stats-box .stat-xu {
    color: #0284c7 !important;
}

[data-bs-theme="light"] .winner-stats-box .stat-label,
.light-theme .winner-stats-box .stat-label {
    color: #4b5563 !important;
}

[data-bs-theme="light"] .badge-custom-ticket,
.light-theme .badge-custom-ticket {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #92400e !important;
    border: 1px solid rgba(217, 119, 6, 0.3) !important;
}

[data-bs-theme="light"] .winner-hall-card .btn-warning,
.light-theme .winner-hall-card .btn-warning {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4) !important;
}

[data-bs-theme="light"] .winner-hall-card .btn-warning:hover,
.light-theme .winner-hall-card .btn-warning:hover {
    background: linear-gradient(135deg, #b45309, #92400e) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================================== */

/* Min-width helper for flex truncation */
.min-w-0 { min-width: 0; }

/* Prevent horizontal shift on small screens */
@media (max-width: 575.98px) {
    .ranking-item:hover {
        transform: none;
    }

    .ranking-item {
        border-left-width: 3px !important;
    }

    .winner-hall-card {
        border-radius: 14px;
    }

    .winner-crown-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        letter-spacing: 0.5px;
    }

    /* Winner stats — stack vertically on xs */
    .winner-stats-box {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100%;
        text-align: center;
    }

    .winner-stats-box .border-start {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px dashed rgba(245, 158, 11, 0.3) !important;
        padding-top: 0.75rem !important;
    }

    .badge-custom-ticket {
        font-size: 0.75rem !important;
    }
}

/* ==========================================================================
   STACKED VOTER AVATAR ROW
   ========================================================================== */

.voter-stack-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.voter-avatar-wrap {
    position: relative;
    margin-left: -10px;
    cursor: pointer;
    transition: transform 0.2s ease, z-index 0s;
}

.voter-avatar-wrap:first-child {
    margin-left: 0;
}

.voter-avatar-wrap:hover {
    transform: translateY(-6px) scale(1.12);
    z-index: 99 !important;
}

/* VIP ring on avatar */
.voter-avatar-wrap .vip-avatar-container {
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.2s ease;
}

.voter-avatar-wrap:hover .vip-avatar-container {
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
    border-color: rgba(245, 158, 11, 0.7);
}

/* Rank badge (small number bottom-right of avatar) */
.voter-rank-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(0,0,0,0.3);
    line-height: 1;
    pointer-events: none;
}

/* #1 badge gets gold glow */
.voter-avatar-wrap:first-child .voter-rank-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
}

[data-bs-theme="light"] .voter-avatar-wrap .vip-avatar-container,
.light-theme .voter-avatar-wrap .vip-avatar-container {
    border-color: rgba(0,0,0,0.12);
}

/* z-index stacking order for voter avatars (0 = front) */
.voter-z-0 { z-index: 10; }
.voter-z-1 { z-index: 9; }
.voter-z-2 { z-index: 8; }
.voter-z-3 { z-index: 7; }
.voter-z-4 { z-index: 6; }
.voter-avatar-wrap:hover { z-index: 99 !important; }
