/* =========================
   RESET
========================= */

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

/* =========================
   BODY
========================= */

body{

    min-height: 100vh;

    display: flex;

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

    flex-direction: column;

    gap: 20px;

    padding: 20px;

    background: linear-gradient(135deg, #120018, #2b0038);

    overflow-x: hidden;
}

/* =========================
   TÍTULO
========================= */

h1{

    text-align: center;

    color: white;

    font-size: 48px;

    letter-spacing: 2px;

    margin-bottom: 10px;
}

/* =========================
   CALCULADORA
========================= */

.calculator{

    width: 100%;
    max-width: 420px;

    background: rgba(255,255,255,0.08);

    padding: 25px;

    border-radius: 30px;

    border: 1px solid rgba(255,255,255,0.08);

    backdrop-filter: blur(10px);

    box-shadow: 0 0 35px rgba(255,0,200,0.35);

    animation: floating 3s ease-in-out infinite;
}

/* =========================
   DISPLAY
========================= */

#display{

    width: 100%;

    height: 90px;

    border: none;

    border-radius: 20px;

    margin-bottom: 20px;

    padding: 20px;

    font-size: 38px;

    font-weight: bold;

    letter-spacing: 2px;

    text-align: right;

    background: #1f1f1f;

    color: white;

    outline: none;
}

/* =========================
   GRID DOS BOTÕES
========================= */

.buttons{

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 15px;
}

/* =========================
   BOTÕES
========================= */

button{

    height: 75px;

    border: none;

    border-radius: 18px;

    font-size: 28px;

    cursor: pointer;

    color: white;

    background: #2b2b2b;

    transition: 0.2s ease;
}

/* Hover */

button:hover{

    transform: scale(1.05);

    background: #3d3d3d;

    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* =========================
   BOTÃO IGUAL
========================= */

.equal{

    grid-column: span 2;

    background: linear-gradient(135deg, #ff00cc, #7b2cff);
}

.equal:hover{

    background: linear-gradient(135deg, #ff33d6, #8d46ff);
}

/* =========================
   FOOTER
========================= */

footer{

    color: #d6d6d6;

    font-size: 15px;

    text-align: center;

    margin-top: 10px;
}

/* =========================
   ANIMAÇÃO
========================= */

@keyframes floating{

    0%{
        transform: translateY(0px);
    }

    50%{
        transform: translateY(-10px);
    }

    100%{
        transform: translateY(0px);
    }

}

/* =========================
   TABLET
========================= */

@media(max-width: 768px){

    h1{
        font-size: 38px;
    }

    .calculator{
        max-width: 360px;
    }

    #display{
        height: 80px;
        font-size: 32px;
    }

    button{
        height: 68px;
        font-size: 24px;
    }

}

/* =========================
   CELULAR
========================= */

@media(max-width: 480px){

    body{
        padding: 15px;
    }

    h1{
        font-size: 32px;
    }

    .calculator{

        width: 100%;

        padding: 20px;

        border-radius: 25px;
    }

    #display{

        height: 75px;

        font-size: 28px;

        padding: 15px;
    }

    .buttons{
        gap: 12px;
    }

    button{

        height: 60px;

        font-size: 22px;

        border-radius: 15px;
    }

    footer{
        font-size: 13px;
    }

}

/* =========================
   CELULARES PEQUENOS
========================= */

@media(max-width: 360px){

    h1{
        font-size: 28px;
    }

    #display{
        font-size: 24px;
    }

    button{
        height: 55px;
        font-size: 20px;
    }

}
/* =========================
   BOTÃO VOLTAR
========================= */

.back-button{

    position: fixed;

    top: 20px;
    left: 20px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 12px 24px;

    border-radius: 40px;

    text-decoration: none;

    color: white;

    font-size: 15px;

    font-weight: 600;

    background: linear-gradient(to right, #ff00c8, #7b2cff);

    box-shadow: 0 0 20px rgba(255,0,200,0.35);

    transition: 0.3s ease;

    z-index: 999;
}

/* Hover do botão */

.back-button:hover{

    transform: translateY(-4px);

    box-shadow: 0 0 30px rgba(255,0,200,0.6);
}

/* Responsividade */

@media(max-width: 600px){

    .back-button{

        top: 15px;
        left: 15px;

        padding: 10px 18px;

        font-size: 13px;
    }

}