/**
 * NVSP Sloganhunt - Badge Styling
 *
 * @package     NVSP.Plugin
 * @subpackage  System.Sloganhunt
 * @copyright   Copyright (C) 2024 NVSP. All rights reserved.
 * @license     GNU General Public License version 2 or later
 *
 * VERSIE: 2.2 - Badge als link met dynamische URL
 */

/* ============================================
   BADGE CONTAINER - NU EEN <a> LINK
   ============================================ */
.sloganhunt-badge {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 120px;
    text-decoration: none;
    color: inherit;
}

.sloganhunt-badge:hover,
.sloganhunt-badge:focus,
.sloganhunt-badge:active {
    text-decoration: none;
    color: inherit;
}

.sloganhunt-badge-right {
    right: 10px;
}

.sloganhunt-badge-left {
    left: 10px;
}

.sloganhunt-badge:hover {
    transform: translateY(-50%) translateX(-10px) scale(1.05);
}

.sloganhunt-badge-left:hover {
    transform: translateY(-50%) translateX(10px) scale(1.05);
}

/* ============================================
   BADGE ICON - GEEN ACHTERGROND
   ============================================ */
.sloganhunt-badge-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sloganhunt-badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.sloganhunt-badge:hover .sloganhunt-badge-icon img {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

/* ============================================
   BADGE INFO - SMART STATES
   ============================================ */

/* DEFAULT STATE - Levendig Blauw (0 letters gevonden) */
.sloganhunt-badge-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    background: linear-gradient(135deg, #0052CC 0%, #2684FF 100%);
    padding: 8px 12px;
    border-radius: 22px;
    box-shadow:
        0 6px 20px rgba(0, 82, 204, 0.5),
        0 0 30px rgba(38, 132, 255, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

/* Shine effect on hover */
.sloganhunt-badge-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.sloganhunt-badge:hover .sloganhunt-badge-info::before {
    left: 100%;
}

.sloganhunt-badge:hover .sloganhunt-badge-info {
    transform: translateY(-3px);
    box-shadow:
        0 10px 30px rgba(0, 82, 204, 0.6),
        0 0 40px rgba(38, 132, 255, 0.3);
}

/* ACTIVE STATE - NVSP Oranje (1-20 letters gevonden) */
.sloganhunt-badge.active .sloganhunt-badge-info {
    background: linear-gradient(135deg, #FF6600 0%, #FF8833 100%);
    box-shadow:
        0 6px 20px rgba(255, 102, 0, 0.5),
        0 0 30px rgba(255, 136, 51, 0.3);
    animation: activeGlow 2s ease-in-out infinite;
}

.sloganhunt-badge.active:hover .sloganhunt-badge-info {
    box-shadow:
        0 10px 30px rgba(255, 102, 0, 0.6),
        0 0 40px rgba(255, 136, 51, 0.4);
}

@keyframes activeGlow {
    0%, 100% {
        box-shadow:
            0 6px 20px rgba(255, 102, 0, 0.5),
            0 0 30px rgba(255, 136, 51, 0.3);
    }
    50% {
        box-shadow:
            0 8px 25px rgba(255, 102, 0, 0.6),
            0 0 40px rgba(255, 136, 51, 0.4);
    }
}

/* COMPLETE STATE - Succes Groen (21/21 letters gevonden) */
.sloganhunt-badge.complete .sloganhunt-badge-info {
    background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
    box-shadow:
        0 6px 20px rgba(0, 200, 83, 0.5),
        0 0 30px rgba(0, 230, 118, 0.3);
    animation: completePulse 2s ease-in-out infinite;
}

.sloganhunt-badge.complete:hover .sloganhunt-badge-info {
    box-shadow:
        0 10px 30px rgba(0, 200, 83, 0.6),
        0 0 40px rgba(0, 230, 118, 0.4);
}

@keyframes completePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 6px 20px rgba(0, 200, 83, 0.5),
            0 0 30px rgba(0, 230, 118, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 10px 30px rgba(0, 200, 83, 0.7),
            0 0 50px rgba(0, 230, 118, 0.5);
    }
}

/* ============================================
   TEKST STYLING
   ============================================ */
.sloganhunt-badge-title {
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.sloganhunt-badge-counter {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    line-height: 1;
    margin-top: 0;
    transition: transform 0.3s ease;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 768px) {
    .sloganhunt-badge {
        width: 110px;
        gap: 10px;
    }

    .sloganhunt-badge-right {
        right: 5px;
    }

    .sloganhunt-badge-left {
        left: 5px;
    }

    .sloganhunt-badge-icon {
        height: 110px;
    }

    .sloganhunt-badge-info {
        padding: 7px 10px;
        min-height: 40px;
    }

    .sloganhunt-badge-title {
        font-size: 7px;
        letter-spacing: 0.3px;
    }

    .sloganhunt-badge-counter {
        font-size: 12px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 480px) {
    .sloganhunt-badge {
        width: 100px;
        top: auto;
        bottom: 80px;
        transform: none;
        gap: 10px;
    }

    .sloganhunt-badge:hover {
        transform: translateY(-5px) scale(1.05);
    }

    .sloganhunt-badge-right {
        right: 10px;
    }

    .sloganhunt-badge-left {
        left: 10px;
    }

    .sloganhunt-badge-icon {
        height: 100px;
    }

    .sloganhunt-badge-info {
        padding: 6px 10px;
        min-height: 38px;
        border-radius: 19px;
    }

    .sloganhunt-badge-title {
        font-size: 6.5px;
        letter-spacing: 0.2px;
    }

    .sloganhunt-badge-counter {
        font-size: 11px;
    }

    .sloganhunt-badge.complete .sloganhunt-badge-info {
        animation: completePulseMobile 2s ease-in-out infinite;
    }

    @keyframes completePulseMobile {
        0%, 100% {
            transform: scale(1);
            box-shadow:
                0 6px 20px rgba(0, 200, 83, 0.5),
                0 0 30px rgba(0, 230, 118, 0.3);
        }
        50% {
            transform: scale(1.05);
            box-shadow:
                0 8px 25px rgba(0, 200, 83, 0.6),
                0 0 40px rgba(0, 230, 118, 0.4);
        }
    }

    .sloganhunt-badge.active .sloganhunt-badge-info {
        animation: activeGlow 2s ease-in-out infinite;
    }
}

/* ============================================
   EXTRA SMALL DEVICES
   ============================================ */
@media (max-width: 360px) {
    .sloganhunt-badge {
        width: 90px;
        bottom: 70px;
    }

    .sloganhunt-badge-icon {
        height: 90px;
    }

    .sloganhunt-badge-info {
        padding: 6px 10px;
        min-height: 36px;
    }

    .sloganhunt-badge-title {
        font-size: 6px;
        letter-spacing: 0.2px;
    }

    .sloganhunt-badge-counter {
        font-size: 10px;
    }
}

/* ============================================
   ACCESSIBILITY - GEEN BORDER
   ============================================ */
.sloganhunt-badge:focus,
.sloganhunt-badge:focus-visible,
.sloganhunt-badge:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .sloganhunt-badge,
    .sloganhunt-badge:hover,
    .sloganhunt-badge-icon,
    .sloganhunt-badge-info,
    .sloganhunt-badge.complete .sloganhunt-badge-info {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   HIDE BADGE WHEN OVERLAY IS ACTIVE
   ============================================ */
body.nvsp-overlay-active .sloganhunt-badge {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sloganhunt-badge.hide-during-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .sloganhunt-badge-icon img {
        filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.2));
    }

    .sloganhunt-badge:hover .sloganhunt-badge-icon img {
        filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.3));
    }
}

/* ============================================
   NOTIFICATION DOT
   ============================================ */
.sloganhunt-badge.has-notification::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: #FF3B30;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: notificationPulse 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Badge glow tijdens letter verzamelen */
.sloganhunt-badge.collecting-letter {
    animation: badgeCollectGlow 0.8s ease-in-out;
}

@keyframes badgeCollectGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 102, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 102, 0, 0.6),
                    0 0 40px rgba(255, 102, 0, 0.4);
        transform: scale(1.05);
    }
}

/* Badge counter transition */
.sloganhunt-badge-counter {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* ============================================
   BADGE UPDATE ANIMATION (v2.1.0)
   ============================================ */
.sloganhunt-badge.badge-updated {
    animation: badgePulse 0.5s ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

.sloganhunt-badge.badge-updated .sloganhunt-badge-counter {
    animation: counterGlow 0.5s ease-in-out;
}

@keyframes counterGlow {
    0%, 100% { color: inherit; }
    50% { color: #ff6b35; text-shadow: 0 0 10px rgba(255, 107, 53, 0.5); }
}
