@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --cor0: #33605a;
    --cor1: #1a3d39;
    --cor2: #91a398;
    --cor3: #7d9987;
    --cor4: #e9e0d1;
    --cor5: #68462b;
    --cor6: #382414;
}

body {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    display: flex;
    flex-direction: column;
}

header {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    margin: 0;
    color: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.titulo {
    font-size: 30px;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    width: 80%;
    max-width: 600px;
}

.span-titulo {
    color: var(--cor4);
    text-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
}

main {
    margin-top: 0;
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    flex-grow: 1;
}

.livros {
    margin-top: 50px;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.livros h2,
h3 {
    color: var(--cor6);
    font-size: 2em;
    margin-bottom: 0.5em;
}

.livros h3 {
    font-size: 1.2em;
    margin-bottom: 2em;
}

.containerbooks {
    margin-top: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    justify-content: center;
    width: 100%;
    flex-direction: column;
}

.form-livros {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    width: 100%;
}

.pesquisar {
    display: flex;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--cor2);
    border-radius: 8px;
    overflow: hidden;
}

.pesquisar .livro {
    flex-grow: 1;
    padding: 12px 15px;
    border: none;
    font-size: 1em;
    outline: none;
    color: var(--cor6);
}

.pesquisar .livro::placeholder {
    color: var(--cor3);
}

.buscar {
    background-color: var(--cor1);
    color: white;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.buscar:hover {
    background-color: var(--cor0);
}

.informações {
    width: 110%;
    margin-left: -9%;
    border-collapse: collapse;
    margin-bottom: 30px;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
    overflow-x: scroll;
}

.informações thead {
    background-color: var(--cor1);
    color: white;
}

.informações tr {
    border-bottom: 3px solid var(--cor0);


}

.informações th,
.informações td {
    padding: 12px 15px;
    border: 1px solid var(--cor2);
    text-align: left;
    vertical-align: top;
}

.informações th {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    text-align: center;
    vertical-align: middle;
}

.informações tbody tr:nth-child(even) {
    background-color: whitesmoke;
}

.informações tbody th:nth-child(10) {
    width: 20%;
}


.informações img {
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.solicitar {
    background-color: var(--cor0);
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.solicitar:hover {
    background-color: var(--cor1);
    transform: translateY(-2px);
}

.status {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.9em;
    white-space: nowrap;
}

.message-box {

    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

@media (max-width: 1550px) {
    .containerbooks {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-direction: column;
        gap: 30px;
    }

    .informações {
        width: 110%;
        margin-left: 0;
    }
}

@media(max-width:1400px) {

    .containerbooks {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-direction: column;
        gap: 30px;
    }

    .informações {
        width: 100%;
        margin-left: 0;

    }

}

@media (max-width: 800px) {
    .informações {
        width: 100%;
        left: 0;
        border: 5px solid var(--cor0);
    }

    .informações caption {
        font-size: 1.3rem;
    }

    .informações thead {
        clip: rect(0 0 0 0);
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        border: 0;
    }

    .informações tr {
        display: block;
        padding: 0;
        margin-bottom: 20px;
        border-radius: 5px;
    }

    .informações td {
        display: block;
        font-size: 1rem;
        padding: 0.5em 1em;
        text-align: right;
    }

    .informações td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.9rem;
    }

    .informações td[data-label="Capa"] {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .informações img {
        margin: 0;
        max-width: 60px;
        height: auto;
    }

    .informações td:last-child {
        border-bottom: 0;
    }
}
