/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    background: #020506;
    background-repeat: repeat;
    background-image: none;
    background-size: auto;
    margin: 0;
    font-family: 'Sahitya', sans-serif;
    font-size: calc(0.8rem + 1vw);
    color: #fff;
    background-image: url(../img/noise.webp);
    background-repeat: repeat;
    background-size: 321px;
}

/* Section Styles */
section {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 100%;
    max-width: 24em;
    min-height: 100vh;
    margin: auto;
    padding: 1em;
    align-items: center;
    justify-content: center;
}

section h1 {
    font-size: 1.8em;
    margin: 0;
    line-height: 0.9;
}

section h4 {
    font-size: 0.7em;
    font-weight: normal;
    margin: 0.8em 0 0.8em;
}

/* Group Styles */
.group,
.boxgroup {
    display: flex;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

.group label,
.boxgroup label {
    flex: 1 0 auto;
    line-height: 3;
    position: relative;
    top: 0em;
    border-bottom: 1px solid #53565a;
}

/* Para navegadores mais modernos */
input::placeholder {
    color: #53565a;
    opacity: 1;
}

/* Para navegadores mais antigos (WebKit) */
input::-webkit-input-placeholder {
    color: #53565a;
}

/* Para navegadores mais antigos (Mozilla) */
input:-moz-placeholder {
    color: #53565a;
    opacity: 1;
}

/* Para navegadores mais antigos (Internet Explorer) */
input:-ms-input-placeholder {
    color: #53565a;
}

.group input,
.boxgroup input {
    min-width: 100px;
    max-width: 0;
    width: 4.8ch;
    color: #57f287;
    flex: 10 0 auto;
    padding: 0 0 0.1em 0.5em;
    font-size: 22px;
    border: none;
    border-bottom: 1px solid #53565a;
    background: none;
    margin: 0;
    text-align: center;
}

.group input:focus {
    outline: none;
}

/* Boxgroup Styles */
.boxgroup {
    justify-content: flex-start;
}

.boxgroup label {
    text-align: left;
    padding-left: 2.4em;
    display: flex;
    align-content: center;
    align-items: center;
}

.boxgroup label:before {
    content: '';
    font-size: 120%;
    line-height: 0.5em;
    width: 0.6em;
    text-indent: -0.4em;
    height: 0.6em;
    border: 1px solid #53565a;
    position: absolute;
    left: 16px;
    margin: 1% 0;
}

.boxgroup label.checked {
    font-weight: bold;
    color: #58d58d;
}

.boxgroup label.checked:before {
    content: '✅';
}

.boxgroup input {
    width: auto;
    margin: 0.32em 0.4em 0 0;
    border-bottom: 1px solid black !important;
    display: none;
}

/* Result Styles */
#result {
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    line-height: 1em;
    font-size: 60px;
    text-align: left;
    justify-content: center;
}

#result .error {
    font-weight: bold;
    color: #ff6347;
    font-size: 40%;
    line-height: normal;
    animation: bounce 0.5s ease-in-out forwards;
}

.result-badge {
    padding: 10px 15px;
    border-radius: 10px 30px;
    display: inline-block;
    text-align: center;
    font-size: 0.8em;
    margin: 5px;
}

/* Button Styles */
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background-color: #18b162c4;
    border: 8px solid #12171a;
    color: white;
    gap: 8px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.button .text {
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: 1px;
}

.button .svg {
    padding-top: 5px;
    height: 100%;
    width: fit-content;
}

.button .svg svg {
    width: 50px;
    height: 30px;
}

.button:hover .svg svg {
    animation: jello-vertical 0.9s both;
    transform-origin: left;
}

/* Animations */
@keyframes jello-vertical {

    0%,
    100% {
        transform: scale3d(1, 1, 1);
    }

    30% {
        transform: scale3d(0.75, 1.25, 1);
    }

    40% {
        transform: scale3d(1.25, 0.75, 1);
    }

    50% {
        transform: scale3d(0.85, 1.15, 1);
    }

    65% {
        transform: scale3d(1.05, 0.95, 1);
    }

    75% {
        transform: scale3d(0.95, 1.05, 1);
    }
}

@keyframes bounce {

    0%,
    50%,
    100% {
        transform: translateY(0);
    }

    25%,
    75% {
        transform: translateY(-0.25em);
    }
}

/* Modal Styles */
.modal,
.history-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;

    align-items: center;
    justify-content: center;

    backdrop-filter: blur(13.5px);
    -webkit-backdrop-filter: blur(13.5px);
    box-shadow: 10px;
    -webkit-box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
    -moz-box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
    box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
}

.modal-content,
.history-modal-content {
    backdrop-filter: blur(13.5px);
    -webkit-backdrop-filter: blur(13.5px);
    box-shadow: 10px;
    -webkit-box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
    -moz-box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
    box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.68);
    color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    content: "";
    background-image: url(../img/noise.webp);
    opacity: .90;
    background-repeat: repeat;
    background-size: 257px auto;
}

.modal-header,
.modal-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-hover:hover {
    transform: scale(1.1);
}

/* Open Modal Button */
.open-modal-button,
.floating-notes-button,
.floating-history-button {
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    background-color: #18b162c4;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin: 20px;
    transition: all 0.2s ease-in-out;
}

.open-modal-button:hover,
.floating-notes-button:hover,
.floating-history-button:hover {
    background-color: #58d58d;
    transform: scale(1.1);
}

/* Floating Buttons */
.floating-notes-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    border-radius: 20%;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-history-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border-radius: 10px 20px 10px;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Notes */
#notes {
    width: 100%;
    height: 500px;
    padding: 10px;
    border: 1px solid #53565a;
    border-radius: 5px;
    background-color: #2a2f32;
    color: #fff;
    resize: none;
    font-size: 1.2rem;
    content: "";
    background-image: url(../img/noise.webp);
    opacity: .90;
    background-repeat: repeat;
    background-size: 257px auto;
}

/* Close Button */
.close-button,
.close-button2 {
    color: #aaa;
    float: right;
    font-size: 46px;
    font-weight: bold;
    cursor: pointer;
    margin: -17px 0 auto;
}

.close-button:hover,
.close-button2:hover,
.close-button:focus,
.close-button2:focus {
    color: #ff6347;
}

/* History List */
#historyList div {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.delete-button {
    font-weight: 700;
    background-color: #ae3030;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-button:hover {
    background-color: #e5533d;
}

/* Responsive Styles */
@media (max-width: 600px) {
    footer {
        height: 18dvh;
    }

    section {
        max-width: 100%;
        min-height: auto;
        padding: 0.5em;
    }

    .group input {
        text-align: left;
    }

    .button {
        padding: 12px 24px;
        font-size: 1.2em;
    }

    .button .svg svg {
        width: 30px;
        height: 20px;
    }

    .modal-content,
    .history-modal-content {
        margin: 5% auto;
        width: 90%;
    }
}

footer {
    color: #57f287;
    font-weight: bold;
    text-align: center;
}

footer a {
    color: #D3C9D6;
}

footer a:hover {
    color: #57a5e6;
}