@charset "utf-8";

:root {
    --bg-body: #F4F6F8;
    --bg-header: #FFFFFF;
    --text-primary: #1C1E21;
    --text-secondary: #4E5D6C;
    --btn-primary: #C8943B;
    --btn-hover: #C8943B;
    --link-color: #4A4A4A;
    --border-color: #D0D7DE;
    --highlight: #7E57C2;
    --shadow-sm: 0 2px 8px rgba(28, 30, 33, 0.1);
    --shadow-hover: 0 4px 12px rgba(28, 30, 33, 0.15);
}

[data-theme="dark"] {
    --bg-body: #0D1117;
    --bg-header: #161B22;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --border-color: #30363D;
    --highlight: #9B6BFF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-weight: 400;
    transition: all 0.3s ease;
}


/* ~~ Seletores de elementos/tag ~~ */

ul,
ol,
dl {
    /* Devido a variações entre navegadores, é recomendado zerar o padding e a margem nas listas. É possível especificar as quantidades aqui ou nos itens da lista (LI, DT, DD) que eles contêm. Lembre-se: o que você fizer aqui ficará em cascata para a lista de navegação a não ser que você escreva outro seletor mais específico. */
    padding: 0;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
    /* ao remover a margem superior, as margens podem escapar das suas containing div. A margem inferior restante vai mantê-la afastada de qualquer elemento que se segue. */
    padding-right: 15px;
    padding-left: 15px;
    /* adicionando o padding para os lados dos elementos dentro dos divs, ao invés dos próprios divs o livra de qualquer combinação de modelo de caixa. Um div aninhado com padding lateral também pode ser usado como método alternativo. */
}

a img {
    /* esse seletor remove a borda azul padrão exibida em alguns navegadores ao redor de uma imagem circundada por um link. */
    border: none;
}


/* ~~ A estilização dos links do seu site deve permanecer nesta ordem – incluindo o grupo de seletores que criam o efeito hover. ~~ */

a:link {
    color: var(--link-color);
    text-decoration: underline;
    transition: all 0.3s ease;
}

a:visited {
    color: var(--text-secondary);
    text-decoration: underline;
}

a:hover,
a:active,
a:focus {
    text-decoration: none;
    color: var(--highlight);
}


/* ~~ esse contêiner de largura fixa envolve os outros divs~~ */

.container {
    width: 100%;
    max-width: 800px;
    max-height: 100%;
    min-height: 600px;
    background: var(--bg-header);
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    transition: all 0.3s ease;
}

#menu ul {
    padding: 0px;
    margin: 0px;
    background-color: var(--bg-header);
    list-style: none;
    font: 20px 'Inter', Arial;
    border-radius: 8px 8px 0 0;
}

#menu ul li {
    display: inline;
}

#menu ul li a {
    background-color: var(--bg-header);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 3px solid var(--bg-header);
    padding: 2px 10px;
    float: left;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

#menu ul li a:hover {
    background-color: var(--highlight);
    color: #FFFFFF;
    border-bottom: 2px solid var(--btn-primary);
}


/* ~ cabeçalho do site~ */

.header {
    background: var(--btn-primary);
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow-sm);
}

#logotipo {
    height: 50px;
    margin-top: 10px;
    display: inline-block;
}

#menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content {
    padding: 10px 0;
}


/* O rodapé  */

.footer {
    padding: 10px 0;
    background: var(--btn-primary);
    text-align: right;
    color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-sm);
}

.fltrt {
    float: right;
    margin-left: 8px;
}

.fltlft {
    margin-right: 8px;
}

.clearfloat {
    clear: both;
    height: 0;
    font-size: 1px;
    line-height: 0px;
}


/*CONTATO*/

.form {
    display: flex;
    justify-content: center;
}

.contato {
    width: 100%;
    max-width: 500px;
}

.field {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-header);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.field:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.1);
}

textarea .field {
    height: 150px;
}

.formface {
    display: flex;
    align-items: center;
    justify-content: center;
}

.formbox input {
    width: 100%;
}

.formbox textarea {
    width: 100%;
}

.textLogo {
    color: white;
    text-decoration: solid;
}

#TextLogo {
    text-shadow: #333;
    background-color: black;
}

#consultabiblioteca {
    align-items: center;
    align-content: center;
    text-align: center;
}


/* === Alertas === */
.alert {
    padding: 15px;
    margin: 15px;
    border-radius: 8px;
    font-weight: 500;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* === Seção de Filtros === */
.filters-section {
    margin: 20px 15px;
    padding: 20px;
    background: var(--bg-body);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.filter-form { margin-top: 15px; }
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}
.filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}
.filter-actions { display: flex; gap: 10px; }

/* === Botões === */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-primary {
    background-color: var(--btn-primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.btn-secondary {
    background-color: var(--text-secondary);
    color: white;
}
.btn-secondary:hover { background-color: #6c757d; }
.btn-add {
    background-color: #28a745;
    color: white;
    font-size: 16px;
}
.btn-add:hover { background-color: #218838; }

/* === Seção de Livros === */
.books-section { margin: 20px 15px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.book-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}
.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.book-header { margin-bottom: 10px; }
.book-title {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
}
.book-genre {
    display: inline-block;
    background-color: var(--highlight);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.book-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 15px 0;
    font-size: 14px;
}
.book-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.btn-delete {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}
.btn-delete:hover { background-color: #c82333; }
.no-books {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* === Formulário de Cadastro/Contato === */
.form-section {
    margin: 20px 15px;
    padding: 20px;
    background: var(--bg-body);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.book-form { margin-top: 15px; }
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* === Responsivo === */
@media (max-width: 768px) {
    .filter-row { grid-template-columns: 1fr; }
    .books-grid { grid-template-columns: 1fr; }
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    .form-actions,
    .filter-actions { flex-direction: column; }
    .btn { width: 100%; }
}