/* public/css/badges.css */
/* FULL VIEWPORT REFACTOR - All px values converted to vw/vh where applicable */

#badges-container {
    padding: 0.5vh 0.5vw;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5vh 0.5vw;
}

#badges-header {
    padding: 1vh 0;
    border-bottom: none;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: clamp(50px, 6vh, 70px);
}

#badges-header::before {
    content: '👑';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 4.5vw, 5rem);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

#badges-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(80px, 10vw, 120px);
    height: clamp(80px, 10vw, 120px);
    background: radial-gradient(circle, var(--color-active-highlight) 0%, transparent 70%);
    opacity: 0.1;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

#total-points {
    transition: all 0.3s ease;
    display: inline-block;
    font-size: clamp(1.4rem, 1.8vw, 2.2rem);
    color: var(--color-active-highlight);
    font-weight: bold;
    text-shadow: 0 0.2vh 0.4vw rgba(0, 0, 0, 0.5);
    z-index: 1;
    position: relative;
}

#total-points.pulse {
    animation: pointsPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--color-active-highlight);
    text-shadow: 0 0 1.5vw rgba(59, 130, 246, 0.8);
}

@keyframes pointsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.badge-icon-card {
    background: var(--color-frame);
    border: 0.1vw solid var(--color-frame);
    padding: 0.5vh 0.5vw !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.badge-icon-card:hover {
    background: var(--color-accent-highlight-1);
    border-color: var(--color-accent-highlight-1);
    transform: translateY(-0.2vh);
    box-shadow: 0 0.4vh 1.2vw rgba(0, 0, 0, 0.3);
}

.badge-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0.2vh;
}

.badge-icon-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.2vh 0.8vw rgba(0, 0, 0, 0.3);
    width: clamp(28px, 3.2vw, 36px) !important;
    height: clamp(28px, 3.2vw, 36px) !important;
    border-radius: 50%;
}

.badge-icon-bg i {
    font-size: clamp(12px, 1.4vw, 16px) !important;
}

.badge-checkmark {
    position: absolute;
    bottom: -0.2vh;
    right: -0.2vw;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.1vw solid var(--color-frame);
    width: clamp(12px, 1.4vw, 16px) !important;
    height: clamp(12px, 1.4vw, 16px) !important;
    border-radius: 50%;
    z-index: 2;
}

.badge-name {
    margin-top: 0.2vh;
    font-size: clamp(0.5rem, 0.62vw, 0.72rem);
    line-height: 1.1;
    color: var(--color-text-main);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-points {
    font-size: clamp(0.48rem, 0.6vw, 0.7rem);
    font-weight: 700;
    color: var(--color-accent-highlight-1);
}

.badge-icon-card.locked .badge-icon-bg {
    opacity: 0.4;
    filter: grayscale(80%);
}

.badge-icon-card.locked .badge-name {
    color: var(--color-text-secondary) !important;
}

.badge-icon-card.locked .badge-points {
    color: var(--color-icon-default) !important;
}

.badge-icon-card.completed .badge-icon-bg {
    opacity: 1;
    filter: none;
}

.badge-icon-card:not(.locked):hover {
    background: var(--color-accent-highlight-1);
    border-color: var(--color-accent-highlight-1);
    transform: translateY(-0.2vh);
    box-shadow: 0 0.4vh 1.2vw rgba(0, 0, 0, 0.3);
}

.badge-icon-card:not(.locked):hover .badge-name,
.badge-icon-card:not(.locked):hover .badge-points {
    color: var(--color-frame) !important;
}

.badge-icon-card.locked:hover {
    background: var(--color-windows-bg);
    border-color: var(--color-frame);
}

.badge-icon-card.locked:hover .badge-icon-bg {
    opacity: 0.5;
    filter: grayscale(40%);
}

.badge-coin-flight {
    position: fixed;
    z-index: 12000;
    width: clamp(16px, 2vw, 24px);
    height: clamp(16px, 2vw, 24px);
    color: var(--color-accent-highlight-1);
    pointer-events: none;
    filter: drop-shadow(0 0 0.5vw rgba(251, 191, 36, 0.8));
    animation: coinFlight 800ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes coinFlight {
    0% {
        transform: translate(0, 0) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(0, -2vh) scale(1.2) rotate(45deg);
    }
    100% {
        transform: translate(var(--coin-end-x), var(--coin-end-y)) scale(0.3) rotate(720deg);
        opacity: 0;
    }
}

.badge-particle {
    position: fixed;
    width: 0.6vh;
    height: 0.6vh;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

.badge-complete-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, var(--color-windows-bg), var(--color-frame));
    color: var(--color-text-main);
    padding: 1.2vh 2.4vw;
    border-radius: 1.2vh;
    font-size: clamp(0.8rem, 1vw, 1.2rem);
    font-weight: bold;
    border: 0.2vw solid var(--color-accent-highlight-1);
    box-shadow: 0 1vh 4vw rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
}

.badge-complete-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.milestone-dropdown,
#points-breakdown {
    background: var(--color-console-main) !important;
    border: 0.1vw solid var(--color-frame) !important;
    color: var(--color-text-main);
}

/* Section Headers - Highlight 1 (lime green from theme) with Bungee Inline font */
.section-header {
    background: var(--color-top-windows-bg);
    border-bottom: 1px solid var(--color-border-secondary);
    position: relative;
    overflow: hidden;
    padding-top: 0.25vh;
    padding-bottom: 0.25vh;
    border-radius: 8px 8px 0 0 !important; /* Top corners rounded */
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    pointer-events: none;
}

.section-header h3 {
    color: var(--font-color-subheaders, #ffffff);
    font-family: 'Bungee Inline', cursive;
    font-size: clamp(0.75rem, 0.9vw, 1rem);
    font-weight: 400;
    position: relative;
    z-index: 1;
    text-align: center;
    margin: 0.25vh 0;
}

#daily-container,
#achievements-container {
    background: var(--color-console-main) !important;
    border-radius: 0 0 8px 8px !important; /* Only bottom corners rounded */
    overflow: hidden !important; /* Ensure content doesn't overflow rounded corners */
}

#jukebot-info-btn.command-tab-btn {
    width: clamp(24px, 2.8vw, 32px);
    height: clamp(24px, 2.8vw, 32px);
    min-width: clamp(24px, 2.8vw, 32px);
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0.2vh 0.8vw rgba(139, 92, 246, 0.4), inset 0 0.1vh 0vw rgba(255,255,255,0.2);
}

#jukebot-info-btn.command-tab-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    transform: translateY(-0.1vh) scale(1.05);
    box-shadow: 0 0.4vh 1.2vw rgba(139, 92, 246, 0.6), inset 0 0.1vh 0vw rgba(255,255,255,0.2);
}

#jukebot-info-btn.command-tab-btn.active {
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    box-shadow: 0 0 1.5vw rgba(139, 92, 246, 0.7), 0 0.4vh 1.2vw rgba(139, 92, 246, 0.4);
}

#jukebot-info-btn.command-tab-btn i {
    font-size: clamp(10px, 1.3vw, 15px);
    color: white;
    filter: drop-shadow(0 0.1vh 0.2vw rgba(0,0,0,0.3));
}

/* Badge in-place expansion */
.badge-icon-card.expanded {
    grid-column: span 1;
    background: var(--color-console-main);
    border: 1px solid var(--color-border-secondary);
    z-index: 10;
}

.badge-expanded-details {
    max-height: 200px;
    overflow-y: auto;
}

.badge-expanded-details::-webkit-scrollbar {
    width: 4px;
}

.badge-expanded-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
