/* xpbar.css */

/* Regular XP Bar */
.xp-wrapper {
    position: relative;
    max-width: 300px; /* Maximum width */
    width: 100%;       /* Allows shrinking */
    padding: 10px;
    box-sizing: border-box; /* Ensures padding is included in width */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0 auto !important;
}

.level-badge {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.9); /* Slight transparency */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3),
    inset 0 0 10px rgba(255, 255, 255, 0.6); /* Shadows */
    backface-visibility: hidden;
}

.level-text {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.level-number {
    font-size: 20px;
}

.level-label {
    font-size: 10px;
    text-transform: uppercase;
}

.xp-container {
    width: 100%;
    height: 40px;
    position: relative;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    border-radius: 20px;
    padding: 3px;
    box-sizing: border-box; /* Ensure padding is included in width */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    margin-left: 20px; /* Adjusted for level badge */
}

.xp-border {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(45deg, #ffd700, #ffa500);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    pointer-events: none;
    overflow: hidden; /* Smooth masking */
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg,
    rgba(255, 215, 0, 0.8),
    rgba(255, 223, 0, 1),
    rgba(255, 215, 0, 0.9));
    border-radius: 17px;
    position: relative;
    overflow: hidden;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    animation: gradientMove 3s linear infinite; /* Removed fillPulse */
}

.xp-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 6s infinite;
    opacity: 0;
    filter: blur(1px);
}

.xp-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 60%,
    transparent 100%);
    animation: shine 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: blur(3px);
}

.xp-details {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.xp-numbers {
    display: flex;
    gap: 3px;
    align-items: center;
    margin-left: 3px;
    margin-right: 3px;
    font-size: 0.8rem;
}

.xp-current {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.xp-max {
    color: #ffa500;
}

.xp-label {
    margin-left: 5px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

/* Mini XP Bar */
.xp-wrapper-mini {
    position: relative;
    max-width: 150px; /* Maximum width */
    width: 100%;       /* Allows shrinking */
    padding: 5px;
    box-sizing: border-box; /* Ensures padding is included in width */
    display: flex;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.level-badge-mini {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border: 1.5px solid rgba(255, 255, 255, 0.9); /* Slight transparency */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3),
    inset 0 0 5px rgba(255, 255, 255, 0.6); /* Shadows */
    backface-visibility: hidden;
    margin-right: 5px;
}

.level-text-mini {
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.xp-bar-and-label {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.xp-container-mini {
    width: 100%;
    height: 20px;
    position: relative;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    border-radius: 10px;
    padding: 2px;
    box-sizing: border-box; /* Ensure padding is included in width */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.xp-border-mini {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(45deg, #ffd700, #ffa500);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    pointer-events: none;
    overflow: hidden; /* Smooth masking */
}

.xp-fill-mini {
    height: 100%;
    background: linear-gradient(90deg,
    rgba(255, 215, 0, 0.8),
    rgba(255, 223, 0, 1),
    rgba(255, 215, 0, 0.9));
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    z-index: 2;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.6));
    animation: gradientMove 3s linear infinite;
}

.xp-label-mini {
    margin-left: 5px;
    font-size: 0.9em;
    color: white;
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}

/* Add hover effect for clickable XP bars */
#header-mini-xp-bar:hover {
    cursor: pointer;
    transform: scale(1.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.xp-bar-clickable:hover {
    cursor: pointer;
    transform: scale(1.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


/* XP bar highlight animation */
@keyframes xpBarHighlight {
    0% {
        box-shadow: 0 0 10px gold;
    }
    100% {
        box-shadow: none;
    }
}

.xp-container-mini.xp-highlight {
    animation: xpBarHighlight 1s ease-out;
}

/* Animations */
@keyframes gradientMove {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(100%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translateY(80%) scale(1);
        opacity: 1;
    }
    80% {
        transform: translateY(20%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
    }
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Added for level-up animation */
.level-up-animation {
    animation: levelUpPulse 2s ease-in-out;
}

@keyframes levelUpPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px gold;
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px gold;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px gold;
    }
}

