* {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.content-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 0;
}

.body-light {
    background: linear-gradient(to bottom right, #FFFFFF, #0e88de);
    color: #000000;
}

.body-dark {
    background: linear-gradient(to bottom right, #474747, #0a4c8a);
    color: white;
}

.body {
    font-family: 'Roboto', sans-serif;
    background-color: #222831;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    overflow: auto;
    padding-bottom: 60px;
}

.header-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: rgba(66, 66, 66, 100);
}

.header-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 100);
}

.header {
    font-weight: bold;
    font-size: 36px;
    display: flex;
    width: 100%;
    height: 50px;
    justify-content: center;
    align-items: center;
}

.theme-buttons {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    flex-direction: row;
    gap: 5px;
}

.image-text {
    font-size: 24px;
    font-weight: bold;
    background-size: auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.theme-buttons button {
    padding: 5px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

.theme-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.boxContainer {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    padding: 20px 0;
    width: 100%;
    flex: 1;
    overflow: auto;
}

.box {
    justify-content: center;
    display: flex;
    max-width: 500px;
    width: 90vw;
    max-height: 700px;
    height: auto;
    background-blend-mode: color;
    border-radius: 20px;
    color: white;
    flex-direction: column;
    align-content: center;
    padding: 15px;
}

.screen-light {
    background: rgba(255, 255, 255, 0);
    color: rgba(66, 66, 66, 100);
}

.screen-dark {
    background: rgba(255, 255, 255, 0);
    color: rgba(255, 255, 255, 100);
}

.screen {
    display: flex;
    max-width: 500px;
    border-radius: 12px;
    margin-bottom: 10px;
    flex-direction: column;
    height: 120px;
    justify-content: flex-start;
}

.calculation {
    text-align: end;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    gap: 10px;
    font-size: 1.5rem;
}

.screenText {
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    gap: 10px;
    font-size: 3rem;
    font-weight: bold;
}

.buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    gap: 10px;
    max-width: 500px;
}

.left-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 3;
    width: 100%;
}

.right-buttons {
    color: rgba(92, 166, 227, 0);
    max-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.calc-button {
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    min-width: 0;
    height: 80px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.calc-button.equal, .calc-button.add, .calc-button.subs, .calc-button.mult, .calc-button.div {
    color: #5CA6E3;
}

@media (hover: hover) {
    .calc-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        background-color: rgba(255, 255, 255, 0.3);
    }
}

.zero {
    flex: 2;
}

.equal {
    flex: 3;
}

@keyframes bubble-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.calc-button:active {
    animation: bubble-pop 0.3s ease;
}

.calc-button.animate {
    animation: bubble-pop 0.3s ease;
}

.box-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.box-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.footer-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 100);
}

.footer-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: rgba(66, 66, 66, 100);
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 0;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    height: 50px;
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
    .footer {
        height: 40px;
    }

    .box {
        margin: 10px;
        height: auto;
        border-radius: 15px;
    }

    .header {
        height: 40px;
        font-size: 24px;
    }

    .image-text {
        font-size: 14px;
    }

    .theme-buttons {
        top: 2px;
        right: 2px;
        gap: 6px;
        padding: 3px 6px;
    }

    .theme-buttons button {
        padding: 4px 8px;
        font-size: 14px;
    }

    .calc-button {
        font-size: 24px;
        height: 50px;
    }

    .calc-button {
        height: 50px;
        font-size: 1rem;
    }

    .buttons {
        padding: 5px;
        gap: 5px;
    }

    .row {
        gap: 5px;
    }
}

.header, .box, .footer, .screen {
    transition: background 1.5s ease, color 1.5s ease;
}

.error-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #f44336;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-family: sans-serif;
    z-index: 9999;
    display: none;
    min-width: 200px;
    max-width: 300px;
    animation: fadeIn 0.3s ease forwards;
}

.error-popup.show {
    display: block;
}

.error-popup .close-btn {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 20px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

