/* member-frames.css - สไตล์กรอบรูปสำหรับแต่ละประเภทสมาชิก */

/* ===== AVATAR FRAMES ===== */

/* Base avatar styling */
.avatar-with-frame {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    cursor: pointer;
    /* Ensure clickability */
    pointer-events: auto;
}

.avatar-with-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    /* Ensure image doesn't block clicks */
    pointer-events: none;
}

/* ===== VIP FRAME ===== */
.avatar-with-frame.vip-frame {
    padding: 3px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700, #FFFF99);
    background-size: 400% 400%;
    animation: vip-glow 3s ease infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.avatar-with-frame.vip-frame::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #FFD700, #FFFF99, #FFA500, #FFD700);
    background-size: 200% 200%;
    border-radius: 50%;
    z-index: -1;
    animation: vip-outer-glow 4s linear infinite;
    opacity: 0.7;
    /* Don't block clicks */
    pointer-events: none;
}

@keyframes vip-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes vip-outer-glow {
    0% { transform: rotate(0deg); opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { transform: rotate(360deg); opacity: 0.6; }
}

/* ===== HOT FRAME ===== */
.avatar-with-frame.hot-frame {
    padding: 3px;
    background: linear-gradient(45deg, #FF4500, #FF6347, #DC143C, #FF4500);
    background-size: 400% 400%;
    animation: hot-glow 2s ease infinite;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
}

.avatar-with-frame.hot-frame::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #FF4500, #FFD700, #FF6347, #FF4500);
    background-size: 200% 200%;
    border-radius: 50%;
    z-index: -1;
    animation: hot-outer-glow 3s linear infinite;
    opacity: 0.8;
    /* Don't block clicks */
    pointer-events: none;
}

.avatar-with-frame.hot-frame::after {
    content: '🔥';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 20px;
    z-index: 3;
    animation: hot-fire 1.5s ease infinite alternate;
    /* Don't block clicks */
    pointer-events: none;
}

@keyframes hot-glow {
    0% { background-position: 0% 50%; transform: scale(1); }
    50% { background-position: 100% 50%; transform: scale(1.05); }
    100% { background-position: 0% 50%; transform: scale(1); }
}

@keyframes hot-outer-glow {
    0% { transform: rotate(0deg); opacity: 0.7; }
    50% { opacity: 1; }
    100% { transform: rotate(360deg); opacity: 0.7; }
}

@keyframes hot-fire {
    0% { transform: scale(0.8) rotate(-5deg); }
    100% { transform: scale(1.2) rotate(5deg); }
}

/* ===== STAR FRAME ===== */
.avatar-with-frame.star-frame {
    padding: 4px;
    background: linear-gradient(45deg, #4169E1, #00BFFF, #1E90FF, #4169E1);
    background-size: 400% 400%;
    animation: star-glow 4s ease infinite;
    box-shadow: 0 0 25px rgba(65, 105, 225, 0.7);
}

.avatar-with-frame.star-frame::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(45deg, #4169E1, #00BFFF, #FFD700, #4169E1);
    background-size: 300% 300%;
    border-radius: 50%;
    z-index: -1;
    animation: star-outer-glow 5s linear infinite;
    opacity: 0.6;
    /* Don't block clicks */
    pointer-events: none;
}

.avatar-with-frame.star-frame::after {
    content: '⭐';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 24px;
    z-index: 3;
    animation: star-twinkle 2s ease infinite;
    /* Don't block clicks */
    pointer-events: none;
}

@keyframes star-glow {
    0% { background-position: 0% 50%; transform: scale(1); }
    25% { transform: scale(1.02); }
    50% { background-position: 100% 50%; transform: scale(1); }
    75% { transform: scale(1.03); }
    100% { background-position: 0% 50%; transform: scale(1); }
}

@keyframes star-outer-glow {
    0% { transform: rotate(0deg); opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { transform: rotate(360deg); opacity: 0.5; }
}

@keyframes star-twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.7; }
}

/* ===== LEGEND FRAME ===== */
.avatar-with-frame.legend-frame {
    padding: 5px;
    background: linear-gradient(45deg, #8A2BE2, #9932CC, #BA55D3, #DDA0DD, #8A2BE2);
    background-size: 500% 500%;
    animation: legend-glow 5s ease infinite;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.8);
}

.avatar-with-frame.legend-frame::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(45deg, #8A2BE2, #FFD700, #9932CC, #FF1493, #8A2BE2);
    background-size: 400% 400%;
    border-radius: 50%;
    z-index: -1;
    animation: legend-outer-glow 6s linear infinite;
    opacity: 0.7;
    /* Don't block clicks */
    pointer-events: none;
}

.avatar-with-frame.legend-frame::after {
    content: '👑';
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 28px;
    z-index: 3;
    animation: legend-crown 3s ease infinite;
    /* Don't block clicks */
    pointer-events: none;
}

@keyframes legend-glow {
    0% { background-position: 0% 50%; transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.02) rotate(1deg); }
    40% { background-position: 50% 50%; transform: scale(1) rotate(-1deg); }
    60% { transform: scale(1.03) rotate(1deg); }
    80% { background-position: 100% 50%; transform: scale(1) rotate(-1deg); }
    100% { background-position: 0% 50%; transform: scale(1) rotate(0deg); }
}

@keyframes legend-outer-glow {
    0% { transform: rotate(0deg); opacity: 0.6; }
    25% { opacity: 0.9; }
    50% { transform: rotate(180deg); opacity: 0.7; }
    75% { opacity: 1; }
    100% { transform: rotate(360deg); opacity: 0.6; }
}

@keyframes legend-crown {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-3deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}

/* ===== GUEST FRAME (ธรรมดา) ===== */
.avatar-with-frame.guest-frame {
    padding: 2px;
    background: linear-gradient(45deg, #C0C0C0, #D3D3D3, #C0C0C0);
    background-size: 200% 200%;
    animation: guest-glow 4s ease infinite;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

@keyframes guest-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== USER FRAME (ไม่มีเอฟเฟกต์) ===== */
.avatar-with-frame.user-frame {
    padding: 1px;
    background: #ddd;
}

/* ===== RESPONSIVE SIZES ===== */

/* Small avatars (32px) */
.avatar-with-frame.size-small {
    width: 32px;
    height: 32px;
}

.avatar-with-frame.size-small.hot-frame::after {
    font-size: 12px;
    top: -4px;
    right: -4px;
}

.avatar-with-frame.size-small.star-frame::after {
    font-size: 14px;
    top: -6px;
    right: -6px;
}

.avatar-with-frame.size-small.legend-frame::after {
    font-size: 16px;
    top: -8px;
    right: -8px;
}

/* Medium avatars (48px) */
.avatar-with-frame.size-medium {
    width: 48px;
    height: 48px;
}

.avatar-with-frame.size-medium.hot-frame::after {
    font-size: 16px;
    top: -6px;
    right: -6px;
}

.avatar-with-frame.size-medium.star-frame::after {
    font-size: 18px;
    top: -8px;
    right: -8px;
}

.avatar-with-frame.size-medium.legend-frame::after {
    font-size: 20px;
    top: -10px;
    right: -10px;
}

/* Large avatars (80px) */
.avatar-with-frame.size-large {
    width: 80px;
    height: 80px;
}

/* Extra large avatars (120px) */
.avatar-with-frame.size-xlarge {
    width: 120px;
    height: 120px;
}

.avatar-with-frame.size-xlarge.hot-frame::after {
    font-size: 32px;
    top: -12px;
    right: -12px;
}

.avatar-with-frame.size-xlarge.star-frame::after {
    font-size: 36px;
    top: -14px;
    right: -14px;
}

.avatar-with-frame.size-xlarge.legend-frame::after {
    font-size: 40px;
    top: -16px;
    right: -16px;
}

/* ===== UTILITY CLASSES ===== */

/* Disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .avatar-with-frame,
    .avatar-with-frame::before,
    .avatar-with-frame::after {
        animation: none !important;
    }
}

/* Hover effects */
.avatar-with-frame:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Focus accessibility */
.avatar-with-frame:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}
