/* Level Progression Bar - Egyptian Theme */
.level-bar {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 350px;
    background: linear-gradient(180deg, #1a0f00 0%, #0d0800 100%);
    border: 2px solid var(--primary-gold);
    border-radius: 35px;
    padding: 15px 8px;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.3), inset 0 0 20px rgba(212, 160, 23, 0.05);
    z-index: 100;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    overflow: hidden;
}

.level-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg,
            rgba(255, 215, 0, 0.3) 0%,
            rgba(212, 160, 23, 0.3) 50%,
            rgba(184, 134, 11, 0.3) 100%);
    border-radius: 35px;
    transition: height 1s ease-out;
    box-shadow:
        inset 0 0 30px rgba(255, 215, 0, 0.2),
        inset 0 0 50px rgba(212, 160, 23, 0.1);
    z-index: 0;
}

.level-item {
    width: 54px;
    height: 90px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #5a4220;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    transition: all 0.3s;
    opacity: 0.5;
}

.level-item.unlocked {
    border-color: var(--primary-gold);
    background: rgba(212, 160, 23, 0.1);
    opacity: 1;
    box-shadow: 0 0 15px rgba(212, 160, 23, 0.3);
}

/* VERY BRIGHT ACTIVE LEVEL */
.level-item.active {
    border: 4px solid #ffd700 !important;
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.9) 0%,
            rgba(212, 160, 23, 0.7) 50%,
            rgba(184, 134, 11, 0.9) 100%) !important;
    box-shadow:
        0 0 40px #ffd700,
        0 0 60px rgba(255, 215, 0, 0.6),
        0 0 80px rgba(212, 160, 23, 0.4),
        inset 0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 50px rgba(212, 160, 23, 0.4) !important;
    animation: mega-pulse 1s infinite !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

@keyframes mega-pulse {
    0% {
        box-shadow:
            0 0 40px #ffd700,
            0 0 60px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(212, 160, 23, 0.3),
            inset 0 0 30px rgba(255, 215, 0, 0.6);
        border-color: #ffd700;
        filter: brightness(1.5);
    }

    50% {
        box-shadow:
            0 0 60px #ffd700,
            0 0 90px rgba(255, 215, 0, 0.6),
            0 0 120px rgba(212, 160, 23, 0.4),
            0 0 150px rgba(184, 134, 11, 0.3),
            inset 0 0 50px rgba(255, 215, 0, 0.8);
        border-color: #ffffff;
        filter: brightness(2);
    }

    100% {
        box-shadow:
            0 0 40px #ffd700,
            0 0 60px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(212, 160, 23, 0.3),
            inset 0 0 30px rgba(255, 215, 0, 0.6);
        border-color: #ffd700;
        filter: brightness(1.5);
    }
}

.level-icon {
    font-size: 22px;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.level-item.unlocked .level-icon {
    filter: grayscale(0%);
}

.level-item.active .level-icon {
    animation: bounce-bright 0.8s infinite !important;
    filter: drop-shadow(0 0 15px #ffffff) drop-shadow(0 0 25px #ffd700) drop-shadow(0 0 35px #d4a017) !important;
    font-size: 26px !important;
}

@keyframes bounce-bright {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.15);
    }
}

.level-info {
    text-align: center;
}

.level-number {
    color: var(--primary-gold);
    font-size: 14px;
    font-weight: 700;
}

.level-rewards {
    color: #8a7050;
    font-size: 9px;
    font-weight: 600;
    margin-top: 2px;
}

.level-item.unlocked .level-rewards {
    color: var(--primary-gold);
}

.level-item.active .level-number {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    text-shadow:
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        0 0 30px #d4a017,
        0 0 40px #d4a017 !important;
    animation: text-glow 1s infinite !important;
}

.level-item.active .level-rewards {
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-shadow:
        0 0 8px #ffd700,
        0 0 15px #d4a017 !important;
}

@keyframes text-glow {

    0%,
    100% {
        text-shadow:
            0 0 10px #ffd700,
            0 0 20px #ffd700,
            0 0 30px #d4a017;
    }

    50% {
        text-shadow:
            0 0 20px #ffd700,
            0 0 30px #ffd700,
            0 0 40px #d4a017,
            0 0 50px #d4a017;
    }
}

/* Mobile adjustments - HORIZONTAL LAYOUT */
@media (max-width: 767px) {
    .level-bar {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 70px;
        margin: 10px auto;
        padding: 8px 12px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        border-radius: 15px;
    }

    .level-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        top: 0;
        width: 0%;
        background: linear-gradient(90deg,
                rgba(255, 215, 0, 0.3) 0%,
                rgba(212, 160, 23, 0.3) 50%,
                rgba(184, 134, 11, 0.3) 100%);
        border-radius: 15px;
        transition: width 1s ease-out;
        box-shadow:
            inset 0 0 20px rgba(255, 215, 0, 0.2),
            inset 0 0 30px rgba(212, 160, 23, 0.1);
        z-index: 0;
    }

    .level-item {
        width: 90px;
        height: 55px;
        flex-direction: row;
        padding: 5px;
        gap: 6px;
    }

    .level-icon {
        font-size: 22px;
    }

    .level-info {
        text-align: left;
    }

    .level-number {
        font-size: 13px;
    }

    .level-rewards {
        font-size: 8px;
    }

    .level-item.active .level-icon {
        font-size: 26px !important;
    }

    .level-item.active .level-number {
        font-size: 15px !important;
    }

    .level-item.active .level-rewards {
        font-size: 9px !important;
    }
}

/* Small phones - extra compact */
@media (max-width: 374px) {
    .level-bar {
        height: 60px;
        padding: 6px 8px;
    }

    .level-item {
        width: 75px;
        height: 48px;
        gap: 4px;
    }

    .level-icon {
        font-size: 18px;
    }

    .level-number {
        font-size: 11px;
    }

    .level-rewards {
        font-size: 7px;
    }

    .level-item.active .level-icon {
        font-size: 22px !important;
    }
}

/* Large phones - slightly bigger */
@media (min-width: 600px) and (max-width: 767px) {
    .level-bar {
        max-width: 550px;
        height: 75px;
        padding: 10px 15px;
    }

    .level-item {
        width: 100px;
        height: 58px;
    }

    .level-icon {
        font-size: 24px;
    }

    .level-number {
        font-size: 14px;
    }

    .level-rewards {
        font-size: 9px;
    }

    .level-item.active .level-icon {
        font-size: 28px !important;
    }

    .level-item.active .level-number {
        font-size: 16px !important;
    }

    .level-item.active .level-rewards {
        font-size: 10px !important;
    }
}

/* Tablet and Desktop - VERTICAL LAYOUT */
@media (min-width: 768px) {
    .level-bar {
        position: fixed;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 70px;
        height: 350px;
        flex-direction: column-reverse;
        padding: 15px 8px;
        border-radius: 35px;
    }

    .level-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: 0%;
        width: auto;
        background: linear-gradient(180deg,
                rgba(255, 215, 0, 0.3) 0%,
                rgba(212, 160, 23, 0.3) 50%,
                rgba(184, 134, 11, 0.3) 100%);
        border-radius: 35px;
        transition: height 1s ease-out;
    }

    .level-item {
        width: 54px;
        height: 90px;
        flex-direction: column;
        padding: 0;
        gap: 4px;
    }

    .level-info {
        text-align: center;
    }
}

/* Large tablets and small desktops */
@media (min-width: 1024px) {
    .level-bar {
        left: 15px;
        width: 80px;
        height: 400px;
    }

    .level-item {
        width: 64px;
        height: 105px;
    }

    .level-icon {
        font-size: 26px;
    }

    .level-number {
        font-size: 16px;
    }

    .level-rewards {
        font-size: 10px;
    }

    .level-item.active .level-icon {
        font-size: 30px !important;
    }

    .level-item.active .level-number {
        font-size: 20px !important;
    }

    .level-item.active .level-rewards {
        font-size: 12px !important;
    }
}

/* Large desktop */
@media (min-width: 1440px) {
    .level-bar {
        left: 20px;
        width: 90px;
        height: 450px;
        padding: 18px 10px;
    }

    .level-item {
        width: 70px;
        height: 115px;
    }

    .level-icon {
        font-size: 28px;
    }

    .level-number {
        font-size: 17px;
    }

    .level-rewards {
        font-size: 11px;
    }

    .level-item.active .level-icon {
        font-size: 34px !important;
    }

    .level-item.active .level-number {
        font-size: 22px !important;
    }
}