/* ═══════════════════════════════════════════
   ZUB BADGES - PREMIUM VISUAL STYLES
   ═══════════════════════════════════════════ */

/* Badge Base */
.zub-badge {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    user-select: none;
    cursor: pointer;
}
.zub-badge:hover {
    transform: scale(1.25) rotate(5deg);
    z-index: 100;
}
.zub-badge:active {
    transform: scale(0.95);
}

/* Tooltip on hover */
.zub-badge::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}
.zub-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ═══ RARITY EFFECTS ═══ */

/* Common - subtle */
.zub-rarity--common { opacity: 0.9; }
.zub-rarity--common:hover { opacity: 1; }

/* Uncommon - green pulse */
.zub-rarity--uncommon {
    animation: zub-pulse-green 3s ease-in-out infinite;
}

/* Rare - blue shimmer */
.zub-rarity--rare {
    animation: zub-shimmer-blue 2.5s ease-in-out infinite;
}

/* Epic - purple glow with rotation */
.zub-rarity--epic {
    animation: zub-glow-epic 2s ease-in-out infinite alternate;
}
.zub-rarity--epic::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #9C27B0, #E040FB, #9C27B0);
    z-index: -1;
    animation: zub-spin-slow 4s linear infinite;
    opacity: 0.5;
}

/* Legendary - golden fire effect */
.zub-rarity--legendary {
    animation: zub-glow-legendary 1.5s ease-in-out infinite alternate;
}
.zub-rarity--legendary::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #FFD700, #FFA000, #FFD700, #FF6F00, #FFD700);
    z-index: -1;
    animation: zub-spin-slow 3s linear infinite;
    opacity: 0.7;
}
.zub-rarity--legendary::after {
    content: '✦';
    font-size: 8px;
    position: absolute;
    top: -2px;
    right: -2px;
    color: #FFD700;
    animation: zub-sparkle 1.5s ease-in-out infinite;
}

/* ═══ ANIMATIONS ═══ */
@keyframes zub-pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
}

@keyframes zub-shimmer-blue {
    0%, 100% { box-shadow: 0 0 8px rgba(33, 150, 243, 0.3); }
    50% { box-shadow: 0 0 16px rgba(33, 150, 243, 0.6), 0 0 32px rgba(33, 150, 243, 0.2); }
}

@keyframes zub-glow-epic {
    from { box-shadow: 0 0 8px #9C27B0, 0 0 16px rgba(156, 39, 176, 0.3); }
    to { box-shadow: 0 0 16px #E040FB, 0 0 32px rgba(224, 64, 251, 0.4); }
}

@keyframes zub-glow-legendary {
    from { box-shadow: 0 0 12px #FFD700, 0 0 24px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 0 24px #FFA000, 0 0 48px rgba(255, 160, 0, 0.4), 0 0 64px rgba(255, 111, 0, 0.2); }
}

@keyframes zub-spin-slow {
    to { transform: rotate(360deg); }
}

@keyframes zub-sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.5); }
}

/* ═══ RANK BADGE ═══ */
.zub-rank {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
    transition: transform 0.2s;
}
.zub-rank:hover {
    transform: scale(1.05);
}
.zub-rank--legend,
.zub-rank--champion {
    animation: zub-rank-shine 3s ease-in-out infinite;
}
@keyframes zub-rank-shine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* ═══ NOTIFICATION TOAST ═══ */
.zub-notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    animation: zub-toast-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 340px;
    backdrop-filter: blur(10px);
}
.zub-notification-toast .zub-toast-icon {
    font-size: 52px;
    text-align: center;
    margin-bottom: 10px;
    animation: zub-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.zub-notification-toast .zub-toast-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #FF6B35, #F7C948);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.zub-notification-toast .zub-toast-desc {
    font-size: 14px;
    color: #444;
    text-align: center;
    font-weight: 500;
}
.zub-notification-toast .zub-toast-points {
    font-size: 13px;
    color: #FF9800;
    text-align: center;
    margin-top: 6px;
    font-weight: 700;
}

@keyframes zub-toast-in {
    from { transform: translateX(120%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes zub-slide-out {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(120%) scale(0.8); opacity: 0; }
}
@keyframes zub-bounce {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ═══ DASHBOARD & PAGES ═══ */
.zub-dashboard-widget { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.zub-achievements-page { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.zub-leaderboard table { font-size: 14px; }
.zub-leaderboard img { border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.zub-my-badges-page h3 { font-size: 16px; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #eee; }
.zub-activity-feed { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ═══ SIDEBAR BADGES ═══ */
.zub-sidebar-badges { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.zs-badges-section { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
    .zub-notification-toast { max-width: calc(100vw - 32px); right: 16px; top: 16px; padding: 16px 20px; }
    .zub-badge::after { display: none; }
}
