@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

* {
    font-family: 'Ubuntu', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --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%, 68%) 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%);
}

body {
    background: #070707;
    color: #fff;
    margin: 0;
}

.battery {
    height: 100vh;
    padding-top: 80px;
    display: grid;
    place-items: center;
    padding: 0 1.5rem;
}

.Bcard {
    position: relative;
    width: 270px;
    height: 240px;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    padding: 0.5rem 1.5rem;
    border-radius: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.Btext {
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.Bpercentage {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #ccc);
    -webkit-background-clip: text;
    color: transparent;
}

.Bstatus {
    position: absolute;
    bottom: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.Bstatus i {
    font-size: 1.25rem;
}

.Bpill {
    position: relative;
    width: 75px;
    height: 180px;
    background-color: rgba(34, 34, 34, 0.8);
    box-shadow: 
        inset 20px 0 48px hsl(0, 0%, 16%),
        inset -4px 12px 48px hsl(0, 0%, 56%),
        0 0 15px rgba(0, 0, 0, 0.3);
    border-radius: 3rem;
    justify-self: flex-start;
    backdrop-filter: blur(5px);
}

.Blevel {
    position: absolute;
    inset: 2px;
    border-radius: 3rem;
    overflow: hidden;
}

.Bliquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--gradient-color-red);
    box-shadow: 
        inset -10px 0 12px hsla(0, 0%, 0%, 0.1),
        inset 12px 0 12px hsla(0, 0%, 0%, 0.15),
        0 0 10px rgba(255, 255, 255, 0.1);
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
}

.Bliquid::after {
    content: "";
    position: absolute;
    height: 8px;
    box-shadow: inset 0 -3px 6px hsla(0, 0%, 0%, 0.2);
    left: 0;
    right: 0;
    margin: 0 auto;
    top: -4px;
    border-radius: 50%;
}

/* Status animations */
.animated-green {
    background: var(--gradient-color-green);
    animation: animated-charging 1.2s infinite alternate;
}

.animated-red {
    background: var(--gradient-color-red);
    animation: animated-low 1.2s infinite alternate;
}

.green-color {
    background: var(--gradient-color-green);
}

.animated-green, .animated-red, .green-color {
    -webkit-background-clip: text;
    color: transparent;
}

/* Keyframes for animations */
@keyframes animated-charging {
    0% {
        text-shadow: none;
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 0 10px hsl(92, 90%, 68%);
        opacity: 1;
    }
}

@keyframes animated-low {
    0% {
        text-shadow: none;
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 0 12px hsl(7, 89%, 46%);
        opacity: 1;
    }
}

/* Gradient backgrounds */
.gradient-color-red {
    background: var(--gradient-color-red);
}

.gradient-color-green {
    background: var(--gradient-color-green);
}

.gradient-color-orange {
    background: var(--gradient-color-orange);
}

.gradient-color-yellow {
    background: var(--gradient-color-yellow);
}

.controls {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ctrl-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0.8rem;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-width: 44px;
    min-height: 44px;
}

@media (hover: hover) {
    .ctrl-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
        background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    }
}

.ctrl-btn:active {
    transform: translateY(0);
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    opacity: 0.8;
}

.ctrl-btn.charging-toggle {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
}

.ctrl-btn.charging-toggle.active {
    background: var(--gradient-color-green);
    color: #000;
}

.ctrl-btn.auto-toggle.active {
    background: var(--gradient-color-yellow);
    color: #000;
}

.ctrl-btn i {
    margin-right: 0.3rem;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .controls {
        gap: 0.8rem;
    }
    
    .ctrl-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

.navbar {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 0.8rem;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.nav-btn:active {
    transform: translateY(0);
    opacity: 0.8;
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .nav-links {
        gap: 0.8rem;
    }
}
