/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
    /*========== Colors ==========*/
    /*Color mode HSL(hue, saturation, lightness)*/
    --gradient-color-red: linear-gradient(90deg, hsl(7, 89%, 46%) 15%, hsl(11, 93%, 68%) 100%);
    --gradient-color-orange: linear-gradient(90deg, hsl(22, 89%, 46%) 15%, hsl(54, 90%, 45%) 100%);
    --gradient-color-yellow: linear-gradient(90deg, hsl(54, 89%, 46%) 15%, hsl(92, 90%, 45%) 100%);
    --gradient-color-green: linear-gradient(90deg, hsl(92, 89%, 46%) 15%, hsl(92, 90%, 68%) 100%);
    --container-color: hsl(0, 0%, 9%);
    --indicator-red: #b80000;
    --indicator-green: #00d200;
    /*========== Font and typography ==========*/
    /*.5rem = 8px | 1rem = 16px ...*/
}

/* Responsive typography */
@media screen and (min-width: 968px) {
    :root {
        --biggest-font-size: 2.75rem;
        --normal-font-size: 1rem;
        --smaller-font-size: .813rem;
    }
}

/*=============== BATTERY ===============*/

.battery__pill {
    position: relative;
    height: 75px;
    background-color: var(--container-color);
    box-shadow: inset 20px 0 48px hsl(0, 0%, 16%), inset -4px 12px 48px hsl(0, 0%, 56%);
    border-radius: 20px;
    justify-self: flex-end;
}

.battery__level {
    position: absolute;
    inset: 2px;
    border-radius: 18px;
    overflow: hidden;
}

.battery__liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 36px;
    background: var(--gradient-color-red);
    box-shadow: inset -10px 0 12px hsla(0, 0%, 0%, .1), inset 12px 0 12px hsla(0, 0%, 0%, .15);
    transition: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .battery__liquid::after {
        content: '';
        position: absolute;
        height: 75px;
        width: 8px;
        background: var(--gradient-color-red);
        box-shadow: inset 10px 0px 15px hsla(0, 0%, 0%, .2);
        right: -5px;
        margin: 0 auto;
        top: 0px;
        border-radius: 50%;
    }

.battery__text {
    /* color: black;
    font-size: 17px;
    transition: transform 0.3s ease;
    word-break: break-all;
    overflow: hidden;
    display: flex;*/

    transform: translate(-50%, -50%);
    position: absolute;
    width: max-content;
    left: 50%;
    top: 50%;
    color: black;
    background-color: #ffffff94;
    z-index: 10000;
    padding: 5px;
    border-radius: var(--bs-border-radius);
    display: flex;
    align-items: center;
}

/* Full battery icon color */
.green-color {
    background: var(--gradient-color-green);
}

/* Battery charging animation */
.animated-green {
    background: var(--gradient-color-green);
    animation: animated-charging-battery 1.2s infinite alternate;
}

/* Low battery animation */
.animated-red {
    background: var(--gradient-color-red);
    animation: animated-low-battery 1.2s infinite alternate;
}

.animated-green,
.animated-red,
.green-color {
    -webkit-background-clip: text;
    color: transparent;
}

@keyframes animated-charging-battery {
    0% {
        text-shadow: none;
    }

    100% {
        text-shadow: 0 0 6px hsl(92, 90%, 68%);
    }
}

@keyframes animated-low-battery {
    0% {
        text-shadow: none;
    }

    100% {
        text-shadow: 0 0 8px hsl(7, 89%, 46%);
    }
}

/* Liquid battery with gradient color */
.gradient-color-red,
.gradient-color-red::after {
    background: var(--gradient-color-red);
}

.gradient-color-orange,
.gradient-color-orange::after {
    background: var(--gradient-color-orange);
}

.gradient-color-yellow,
.gradient-color-yellow::after {
    background: var(--gradient-color-yellow);
}

.gradient-color-green,
.gradient-color-green::after {
    background: var(--gradient-color-green);
}

/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 320px) {
    .battery__card {
        zoom: .8;
    }
}

/* For medium devices */
@media screen and (min-width: 430px) {
    .battery__card {
        width: 312px;
    }
}

/* For large devices */
@media screen and (min-width: 1024px) {
    .battery__card {
        zoom: 1.5;
    }
}

.indicator-color-green {
    background: var(--indicator-green);
}

.indicator-color-red {
    background: var(--indicator-red);
}
