/**
 * Christmas Theme Override for Chatbox & Leaderboard
 * Tuyết phủ và không khí Noel
 */

/* ====================================
   CHATBOX WIDGET - CHRISTMAS THEME
   ==================================== */

/* Snow overlay effect for chatbox */
.chatbox-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* Chatbox widget - Christmas colors */
.chatbox-widget {
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.95) 0%,    /* Christmas Red */
        rgba(22, 91, 51, 0.95) 100%     /* Christmas Green */
    ) !important;
    border-left: 3px solid var(--christmas-gold, #FFD700) !important;
    box-shadow: 
        -5px 0 30px rgba(196, 30, 58, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 60px rgba(255, 255, 255, 0.05) !important;
}

/* Chatbox header - Red & Gold gradient */
.chatbox-header {
    background: linear-gradient(135deg, 
        #c41e3a 0%,      /* Christmas Red */
        #165b33 50%,     /* Christmas Green */
        #c41e3a 100%     /* Christmas Red */
    ) !important;
    border-bottom: 2px solid rgba(255, 215, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Snowflakes decoration on header */
.chatbox-header::after {
    content: '❄️ 🎄 ⭐ 🎅 🎁 ❄️';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.4;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Chatbox body - Frosted glass effect */
.chatbox-body {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(10px);
}

/* Messages - Christmas styling */
.message {
    background: rgba(255, 255, 255, 0.08) !important;
    border-left: 3px solid transparent;
    border-image: linear-gradient(135deg, #c41e3a, #165b33, #FFD700) 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

/* User message highlight */
.message.user-message {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.1) !important;
}

/* Moderator message */
.message.moderator {
    border-left-color: #c41e3a;
    background: rgba(196, 30, 58, 0.15) !important;
}

/* Chatbox footer - Christmas theme */
.chatbox-footer {
    background: linear-gradient(180deg,
        rgba(22, 91, 51, 0.3),
        rgba(196, 30, 58, 0.3)
    );
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

/* Input field - Frosted effect */
#message-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 215, 0, 0.3) !important;
    color: #fff !important;
    backdrop-filter: blur(5px);
}

#message-input:focus {
    border-color: #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Send button - Christmas colors */
#send-btn {
    background: linear-gradient(135deg, #c41e3a, #165b33) !important;
    border: 2px solid #FFD700 !important;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

#send-btn:hover {
    background: linear-gradient(135deg, #165b33, #c41e3a) !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

/* Login button */
.google-login-btn {
    background: linear-gradient(135deg, #c41e3a, #FFD700) !important;
    border: 2px solid #165b33 !important;
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.4);
}

.google-login-btn:hover {
    background: linear-gradient(135deg, #FFD700, #c41e3a) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

/* ====================================
   LEADERBOARD - CHRISTMAS THEME
   ==================================== */

/* Snow overlay for leaderboard */
#leaderboard-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    border-radius: 20px 20px 0 0;
    opacity: 0.7;
}

/* Leaderboard widget - Christmas gradient */
#leaderboard-widget {
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.95) 0%,    /* Christmas Red */
        rgba(22, 91, 51, 0.95) 50%,    /* Christmas Green */
        rgba(196, 30, 58, 0.95) 100%   /* Christmas Red */
    ) !important;
    border: 3px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 
        0 20px 60px rgba(196, 30, 58, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3),
        inset 0 0 80px rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px) !important;
}

/* Leaderboard header */
.leaderboard-header {
    position: relative;
    z-index: 2;
    border-bottom: 2px solid rgba(255, 215, 0, 0.5) !important;
}

.leaderboard-header h2 {
    background: linear-gradient(135deg, #FFD700, #FFF, #FFD700) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 2px 10px rgba(255, 215, 0, 0.5));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: drop-shadow(0 2px 10px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 2px 15px rgba(255, 215, 0, 0.8)); }
}

/* Christmas decoration on leaderboard title */
.leaderboard-header h2::before {
    content: '🎄';
    margin-right: 8px;
    animation: rotate360 4s linear infinite;
}

.leaderboard-header h2::after {
    content: '🎅';
    margin-left: 8px;
    animation: wave 2s ease-in-out infinite;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* Leaderboard subtitle */
.leaderboard-header .subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
}

.leaderboard-header .subtitle::before {
    content: '❄️ ';
}

.leaderboard-header .subtitle::after {
    content: ' ❄️';
}

/* Leaderboard header buttons - Christmas theme */
.leaderboard-header .header-buttons button {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.2), rgba(22, 91, 51, 0.2)) !important;
    border: 1px solid rgba(255, 215, 0, 0.4) !important;
    color: #FFD700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-header .header-buttons button:hover {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.4), rgba(22, 91, 51, 0.4)) !important;
    border-color: #FFD700 !important;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Leaderboard list - Frosted glass */
.leaderboard-list {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* Scrollbar - Christmas colors */
.leaderboard-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c41e3a, #FFD700, #165b33) !important;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #FFD700, #c41e3a, #165b33) !important;
}

/* Leaderboard items - Christmas styling */
.leaderboard-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3) !important;
}

/* Top 1 - Gold with snowflakes */
.leaderboard-item.top-1 {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.25), 
        rgba(255, 165, 0, 0.15)
    ) !important;
    border-color: #FFD700 !important;
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 0.5),
        0 5px 15px rgba(255, 215, 0, 0.3) !important;
    position: relative;
}

.leaderboard-item.top-1::before {
    content: '👑';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Top 2 - Silver with snow */
.leaderboard-item.top-2 {
    background: linear-gradient(135deg, 
        rgba(192, 192, 192, 0.25), 
        rgba(169, 169, 169, 0.15)
    ) !important;
    border-color: #C0C0C0 !important;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.4) !important;
}

.leaderboard-item.top-2::after {
    content: '⭐';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
    animation: twinkle 2s ease-in-out infinite;
}

/* Top 3 - Bronze with ornament */
.leaderboard-item.top-3 {
    background: linear-gradient(135deg, 
        rgba(205, 127, 50, 0.25), 
        rgba(184, 115, 51, 0.15)
    ) !important;
    border-color: #CD7F32 !important;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4) !important;
}

.leaderboard-item.top-3::after {
    content: '🎁';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
}

/* Current user highlight */
.leaderboard-item.current-user {
    border: 2px solid #FFD700 !important;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 215, 0, 0.1) !important;
}

/* Rank styling */
.leaderboard-rank.gold {
    color: #FFD700 !important;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.8),
        0 2px 5px rgba(255, 215, 0, 0.5) !important;
}

.leaderboard-rank.silver {
    color: #E8E8E8 !important;
    text-shadow: 
        0 0 15px rgba(192, 192, 192, 0.8),
        0 2px 5px rgba(192, 192, 192, 0.5) !important;
}

.leaderboard-rank.bronze {
    color: #FF9F66 !important;
    text-shadow: 
        0 0 15px rgba(205, 127, 50, 0.8),
        0 2px 5px rgba(205, 127, 50, 0.5) !important;
}

/* Avatar - Christmas border */
.leaderboard-avatar {
    border: 2px solid rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.leaderboard-item.top-1 .leaderboard-avatar {
    border-color: #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Level badge - Christmas colors */
.leaderboard-level {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Toggle button - Christmas themed */
.leaderboard-toggle {
    background: linear-gradient(135deg, #c41e3a, #FFD700, #165b33) !important;
    border: 3px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        0 5px 25px rgba(196, 30, 58, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4) !important;
}

.leaderboard-toggle:hover {
    box-shadow: 
        0 8px 35px rgba(255, 215, 0, 0.7),
        0 0 30px rgba(196, 30, 58, 0.6) !important;
    animation: jingle 0.5s ease-in-out;
}

@keyframes jingle {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-10deg); }
    75% { transform: scale(1.15) rotate(10deg); }
}

/* Separator - Christmas styled */
.leaderboard-separator {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.5), 
        rgba(196, 30, 58, 0.5),
        rgba(255, 215, 0, 0.5), 
        transparent
    ) !important;
}

.leaderboard-separator::before {
    content: '🎄' !important;
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.8),
        rgba(22, 91, 51, 0.8)
    );
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====================================
   FLOATING SNOWFLAKES EFFECT
   ==================================== */

/* Snowflakes for widgets */
.chatbox-widget .snowflake,
#leaderboard-widget .snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    animation: fall 10s linear infinite;
    pointer-events: none;
}

@keyframes fall {
    0% {
        top: -10%;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0.3;
    }
}

/* ====================================
   RESPONSIVE ADJUSTMENTS
   ==================================== */

@media (max-width: 768px) {
    .chatbox-widget {
        width: 100% !important;
    }
    
    #leaderboard-widget {
        width: calc(100vw - 20px) !important;
        max-width: 350px;
    }
}

/* ====================================
   MINIMIZED STATE OVERRIDES
   ==================================== */

.chatbox-widget.minimized {
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.98),
        rgba(22, 91, 51, 0.98)
    ) !important;
    border: 3px solid #FFD700 !important;
    box-shadow: 
        0 5px 25px rgba(196, 30, 58, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4) !important;
}
