@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: #e6e6e6;
    overflow: hidden; /* Prevents body scrolling */
}

header {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background-color: #001358;
}

.heading {
    color: #ffcc33;
    font-size: 2rem; /* Slightly smaller font size */
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
}

.container {
    height: 600px; /* Reduced height */
    width: 700px; /* Reduced width */
    background-color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 8px;
}

.container-header {
    display: block;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0; /* Reduced margin */
}

.container-header input {
    width: 300px; /* Adjust input width */
    padding: 8px; /* Reduced padding */
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.push,
.pop,
.reset {
    padding: 8px 16px; /* Adjusted padding */
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
    background: linear-gradient(145deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
}

.push:hover,
.pop:hover,
.reset:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, #2575fc 0%, #6a11cb 100%);
}

.container-body {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 3px; /* Adjust padding */
    width: 100%;
}

.stack {
    width: 40%; /* Reduced width */
    height: 400px; /* Reduced height */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border: 2px solid #1f4068;
    border-radius: 10px;
    background-color: #f0f4f8;
    padding-bottom: 10px;
}

.main-stack-bucket {
    width: 80%; /* Adjusted to fit smaller stack */
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 8px; /* Reduced gap between elements */
}

#stk{
  margin-right: 47%;
}

.ele {
    width: 90%;
    padding: 10px; /* Reduced padding */
    background-color: #6a11cb;
    color: #fff;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.info {
    width: 40%; /* Reduced width */
    padding: 10px; /* Adjusted padding */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Adjusted gap */
}

.sec1,
.sec2,
.sec3,
.sec4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box {
    padding: 8px; /* Reduced padding */
    width: 120px; /* Reduced width */
    font-size: 0.9rem;
    text-align: center;
    background-color: #f0f4f8;
    border-radius: 5px;
    border: 1px solid #ccc;
    color: #333;
}

.message-box {
    margin-top: 20px; /* Adjusted margin */
    padding: 10px; /* Adjusted padding */
    border-radius: 10px;
    background-color: #89ff91;
    text-align: center;
    font-weight: 500;
    color: #1f4068;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.message {
    margin-top: 10px;
    font-size: 1.2rem; /* Slightly reduced font size */
}

.error-message {
    animation: errorMessage 0.4s infinite alternate;
}

@keyframes errorMessage {
    from {
        background-color: #ffe5e2;
    }
    to {
        background-color: #ff6f61;
    }
}

footer {
  width: 100%;
  text-align: center;
  padding: 0 10px;
  margin-top: 10px;
  margin-bottom: 10px;

  background-color: #001358;
  color: #ffcc33;
}