@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to right top, #119dff, #14ff70);
    animation: backgroundAnimation 20s ease infinite alternate;
}

@keyframes backgroundAnimation {
    0% {
        background: linear-gradient(to right top, #119dff, #14ff70);
    }

    100% {
        background: linear-gradient(to right top, #14ff70, #119dff);
    }
}

.container {
    height: 620px;
    width: 90%;
    /* Adjusted width for smaller screens */
    max-width: 1000px;
    /* Added maximum width for larger screens */
    background-color: #f0f0f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    animation: containerAnimation 3s ease infinite alternate;
}

@keyframes containerAnimation {
    0% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(10px);
    }
}

.container-header {
    height: 90px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    margin-top: 10px;
    animation: headerAnimation 2s ease infinite alternate;
}

@keyframes headerAnimation {
    0% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.container-header input {
    height: 50px;
    width: 80%;
    /* Adjusted input field width */
    max-width: 400px;
    /* Added maximum width for larger screens */
    font-size: 25px;
    border-radius: 10px;
    padding-left: 20px;
    padding-right: 5px;
    border: 2px solid #777;
    transition: border-color 0.3s ease;
}

.container-header input:focus {
    border-color: #00bcd4;
}

.push,
.pop,
.reset,
.box {
    height: 50px;
    width: 120px;
    /* Adjusted button sizes */
    max-width: 140px;
    /* Added maximum width for larger screens */
    font-size: 20px;
    /* Adjusted font size for buttons */
    background-color: #4caf50;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    outline: none;
}

.push:hover,
.pop:hover,
.reset:hover,
.box:hover {
    background-color: #388e3c;
    animation: buttonHoverAnimation 0.3s infinite alternate;
}

@keyframes buttonHoverAnimation {
    0% {
        transform: translateY(-3px);
    }

    100% {
        transform: translateY(3px);
    }
}

.disable-button {
    background-color: #757575;
    cursor: not-allowed;
}

.container-header button:active {
    transform: scale(0.95);
}

.container-body {
    width: 1000px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.stack {
    width: 500px;
    height: 470px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-width: 0 3px 0 0;
    border-color: black;
    border-style: solid;
}

.main-stack-bucket {
    height: 450px;
    width: 200px;
    border-width: 0 4px 4px 4px;
    border-color: black;
    border-style: solid;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: end;
    align-items: center;
    flex-direction: column-reverse;
    gap: 5px;
    padding-bottom: 5px;
}

.ele {
    height: 80px;
    width: 170px;
    background-color: #4caf50;
    color: white;
    border: 4px solid #333;
    border-radius: 10px;
    font-size: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.ele-add {
    animation: pushAnimation 0.3s infinite linear;
}

.ele-remove {
    animation: popAnimation 0.3s infinite linear;
}

@keyframes pushAnimation {
    0% {
        background-color: #4caf50;
    }

    100% {
        background-color: #115cff;
    }
}

@keyframes popAnimation {
    0% {
        background-color: #4caf50;
    }

    100% {
        background-color: #ff0f3b;
    }
}

.info {
    height: 470px;
    width: 80%;
    /* Adjusted width for smaller screens */
    max-width: 500px;
    /* Added maximum width for larger screens */
    padding-left: 20px;
    font-size: 20px;
    /* Adjusted font size for info box */
}

[class^="sec"] {
    display: flex;
    width: 90%;
    /* Adjusted width for smaller screens */
    max-width: 350px;
    /* Added maximum width for larger screens */
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    justify-content: space-between;
}

.message-box {
    height: 180px;
    width: 80%;
    /* Adjusted width for smaller screens */
    max-width: 400px;
    /* Added maximum width for larger screens */
    margin-top: 30px;
    padding: 10px;
    border-radius: 10px;
    background-color: #fff3e0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 20px;
    /* Adjusted font size for messages */
}

.message-box h2 {
    text-align: center;
    font-weight: 600;
    color: #ff5722;
}

.message {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.error-massage {
    animation: errorMassage 0.4s infinite linear;
}

@keyframes errorMassage {
    0% {
        background-color: #fff3e0;
    }

    100% {
        background-color: #ff0f3b;
    }
}

/* Media query for mobile view */
@media screen and (max-width: 768px) {
    .container {
        width: 95%;
        /* Further reduce container width for smaller screens */
    }

    .container-header input {
        width: 100%;
        /* Full width for input field on mobile */
    }

    .push,
    .pop,
    .reset,
    .box {
        width: 100px;
        /* Further reduce button sizes for mobile */
        max-width: 120px;
        /* Further reduce maximum button width for mobile */
        font-size: 18px;
        /* Adjusted font size for buttons on mobile */
    }

    .message-box {
        width: 95%;
        /* Further reduce message box width for mobile */
        max-width: 90%;
        /* Further reduce maximum message box width for mobile */
        font-size: 18px;
        /* Adjusted font size for messages on mobile */
    }

    [class^="sec"] {
        width: 95%;
        /* Further reduce section width for smaller screens */
        max-width: 80%;
        /* Further reduce maximum section width for smaller screens */
    }
}