/* ============================================= */
/* === ESTILOS GERAIS E RESET === */
/* ============================================= */

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    color: #333;
    /* Correção Google Translate */
    top: 0 !important;
}

/* ============================================= */
/* === CABEÇALHO PRINCIPAL (HEADER) === */
/* ============================================= */

/* Estrutura Principal do Header */
.site-header {
    width: 100%;
    background: linear-gradient(90deg, #800080, #FF4500);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateZ(0); 
}

.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Camada Superior: Logo e Conta */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.header-logo img {
    height: 55px;
    display: block;
}

.header-account {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-account a {
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.header-account a:hover {
    color: #FFD700;
}

.translator-container {
    line-height: 1;
}

/* Camada Inferior: Navegação e Busca */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navegação Principal (Menu) */
.header-nav {
    flex-grow: 1;
}
.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

.header-nav ul li a {
    color: white;
    font-weight: bold;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 0;
    display: block;
    position: relative;
}

.header-nav ul li a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #FFD700;
    transition: width 0.3s ease;
}

.header-nav ul li:hover > a:after {
    width: 100%;
}
.header-nav ul li a .fa-chevron-down {
    font-size: 0.8em;
    margin-left: 5px;
}

/* Dropdowns do Menu */
.header-nav .dropdown {
    position: relative;
    display: inline-block; /* Isso ajuda a conter o dropdown */
}
.header-nav .dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* Garante que comece imediatamente abaixo */
    left: -15px;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    z-index: 1031;
    border-radius: 6px;
    padding: 8px 0;
    margin-top: 2px; /* Uma pequena margem pode ser útil, mas excessiva causa problemas */
    border: 1px solid #ddd;
}
.header-nav .dropdown:hover .dropdown-content {
    display: block;
}
.header-nav .dropdown .dropdown-content a {
    color: #333;
    padding: 10px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: normal;
}
.header-nav .dropdown .dropdown-content a:hover {
    background-color: #f5f5f5;
    color: #800080;
}
.header-nav .dropdown .dropdown-content a:after {
    display: none;
}
.header-nav .dropdown .dropdown-content i {
    width: 16px;
    text-align: center;
}

/* Barra de Busca */
.header-search {
    max-width: 380px;
    width: 100%;
}
.header-search form {
    display: flex;
    width: 100%;
}
.header-search input {
    flex-grow: 1;
    border: none;
    border-radius: 20px 0 0 20px;
    padding: 9px 18px;
    font-size: 14px;
    height: 40px;
    color: #333;
}
.header-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #FFD700;
}

.header-search button {
    border: none;
    background-color: #E63E00;
    color: white;
    border-radius: 0 20px 20px 0;
    padding: 0 18px;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 40px;
}
.header-search button:hover {
    background-color: #c0392b;
}

/* ============================================= */
/* === MENU MOBILE E COMPONENTES RESPONSIVOS === */
/* ============================================= */

/* Ícones do Cabeçalho Mobile */
.mobile-header-icons {
    display: none;
    align-items: center;
    gap: 12px;
}

.mobile-search-toggle, .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    padding: 5px;
    cursor: pointer;
}

/* Overlay de Busca Mobile */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1050;
    display: flex;
    justify-content: center;
    padding-top: 20vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.search-overlay form {
    display: flex;
    width: 90%;
    max-width: 500px;
    height: 50px;
}
.search-overlay input {
    flex-grow: 1;
    border-radius: 25px 0 0 25px;
    border: none;
    padding: 0 20px;
    font-size: 16px;
}
.search-overlay button {
    border: none;
    background-color: #FF4500;
    color: white;
    padding: 0 20px;
    border-radius: 0 25px 25px 0;
    font-size: 18px;
}

.close-search-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
}

/* Menu Mobile */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(90deg, #800080, #FF4500);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu .close-menu {
    position: absolute;
    top: 15px;
    right: 20px;
    background: white;
    border: none;
    color: #FF4500;
    font-size: 24px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 50%;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
    line-height: 1;
}

.mobile-menu .close-menu:hover {
    background: #FFD700;
    color: #800080;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    text-align: center;
    width: 100%;
    margin-top: 40px;
}

.mobile-menu ul li {
    margin: 15px 0;
    position: relative;
}

.mobile-menu ul li a {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 0;
    display: block;
    transition: color 0.3s;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a:focus {
    color: #FFD700;
    outline: none;
}

/* Dropdowns no menu mobile */
.mobile-menu ul .dropdown {
    cursor: pointer;
    position: relative;
    width: 100%;
    text-align: center;
}

.mobile-menu ul .dropdown > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
}

.mobile-menu ul .dropdown > a i {
    margin-left: 8px;
    transition: transform 0.3s ease-in-out;
}

.mobile-menu ul .dropdown-menu {
    display: none;
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 5px;
    padding: 10px 0;
    text-align: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-in-out, max-height 0.4s ease-in-out;
}

.mobile-menu ul .dropdown-menu a {
    display: block;
    font-size: 16px;
    padding: 8px 0;
    color: white;
    font-weight: normal;
    transition: color 0.3s;
}

.mobile-menu ul .dropdown-menu a:hover {
    color: #FFD700;
}

.mobile-menu ul .dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    max-height: 500px;
}

.mobile-menu ul .dropdown.active > a i {
    transform: rotate(180deg);
}

/* Botões de Destaque no Menu Mobile */
.mobile-menu-actions {
    padding: 20px 15px 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-mobile-menu-action {
    display: block;
    padding: 12px;
    border-radius: 25px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.btn-mobile-menu-action:active {
    transform: scale(0.98);
}

/* Botão de Login em destaque */
.btn-mobile-menu-action.btn-login {
    background-color: white;
    color: #FF4500;
}

/* Botão de Cadastro com borda */
.btn-mobile-menu-action.btn-signup {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

/* ============================================= */
/* === LISTAGEM DE EBOOKS === */
/* ============================================= */

.ebook-container {
    display: grid;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

/* Card de Ebook */
.ebook-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.ebook-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Container da Imagem */
.ebook-image-container {
    position: relative;
    display: block;
    line-height: 0;
}

/* Imagem da Capa */
.ebook-cover {
    width: 100%;
    height: auto;
    display: block;
}

/* Selo "EM BREVE" */
.coming-soon-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    display: inline-block;
    padding: 8px;
    border-radius: 4px;
    background-color: #E63E00;
    background-image: linear-gradient(to bottom, #FF5722, #E63E00);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    outline: 1px solid rgba(255, 255, 255, 0.7);
    outline-offset: -1px;
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: default;
}

/* Conteúdo do Card */
.ebook-content {
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    flex-grow: 1;
}

.ebook-title {
    font-size: 16px;
    font-weight: 600;
    margin: 5px 0;
    color: #2c3e50;
    word-wrap: break-word;
    padding: 0 5px;
}

.ebook-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
    flex-grow: 1;
    padding: 0 5px;
}

/* Rodapé do Card */
.ebook-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f9f9f9;
    padding: 10px;
    margin-top: auto;
}

.saiba-mais {
    margin-bottom: 15px;
}

.ebook-author {
    font-size: 12px;
    color: #555;
}

/* ============================================= */
/* === BOTÕES E COMPONENTES === */
/* ============================================= */

/* Botão "Saiba mais" */
.btn-saiba-mais {
    display: inline-block;
    padding: 10px 18px;
    background: linear-gradient(45deg, #d42a80, #ff5722);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn-saiba-mais:hover {
    background: linear-gradient(45deg, #ff5722, #d42a80);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
}

.btn-saiba-mais:focus,
.btn-saiba-mais:active,
.btn-saiba-mais:visited {
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* Botões customizados (Ex: PDF, EPUB) */
.custom-button-container {
    display: flex;
    gap: 5px;
}

.custom-btn {
    width: 62px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.custom-btn i {
    margin-right: 5px;
}

.custom-btn-pdf {
    background-color: #ff5722;
}

.custom-btn-epub {
    background-color: #4caf50;
}

.custom-btn-pageflip {
    background-color: #2196f3;
}

/* Botão de logout */
.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
    font-size: 14px;
}

.btn-logout i {
    font-size: 16px;
    margin-right: 8px;
}

.btn-logout:hover {
    background: #c0392b;
    color: white;
}

/* Container para a avaliação (Estrelas) */
.rating-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 8px 0;
    font-size: 16px;
    height: 24px;
}

.rating-container a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-weight: bold;
    transition: color 0.3s ease;
}

.rating-container a:hover {
    color: #FF4500;
}

.rating-stars {
    font-size: 18px;
    color: #FFD700;
    line-height: 1;
}

.rating-count {
    font-size: 13px;
    color: #555;
    font-weight: bold;
}

/* Wrapper para estrelas */
.rating-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 5px 0;
    margin: 0 auto;
    background: #f9f9f9;
}

/* ============================================= */
/* === MODAIS E COMPONENTES ESPECIAIS === */
/* ============================================= */

/* Estilos do Modal (Footer) */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.social-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: auto;
    margin-bottom: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.social-link i {
    margin-right: 8px;
    font-size: 20px;
    width: 20px;
    text-align: center;
}
.social-link i.fa-instagram { color: #E1306C; }
.social-link i.fa-facebook-square { color: #1877F2; }

.social-link:hover {
    color: #FF4500;
}
.social-link:hover i {
    color: inherit;
}

/* Estilos Itens Diário (Exemplo) */
.diario-item {
    cursor: pointer;
    padding: 8px 8px 8px 35px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
    display: block;
}

.diario-item:hover {
    background-color: #f0f0f0;
}

.diario-checkbox {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    cursor: pointer;
    height: 18px;
    width: 18px;
}

.form-check-label {
    cursor: pointer;
    display: block;
}

/* Modal de Escolha */
.modal-user-choice .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.modal-user-choice .modal-header {
    background: linear-gradient(90deg, #800080, #FF4500);
    color: white;
    border-bottom: none;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
}
.modal-user-choice .modal-header .modal-title {
    font-size: 1.5rem;
    font-weight: bold;
}
.modal-user-choice .modal-header .close {
    color: white;
    opacity: 0.9;
    font-size: 1.8rem;
    text-shadow: none;
}
.modal-user-choice .modal-body {
    padding: 30px 35px;
    text-align: center;
}
.modal-user-choice .modal-body p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
}
.modal-user-choice .choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-user-choice .btn-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #eee;
    color: #444;
    transition: all 0.3s ease;
}
.modal-user-choice .btn-choice:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #FF4500;
    color: #FF4500;
}
.modal-user-choice .btn-choice i {
    font-size: 1.8rem;
    margin-right: 15px;
    width: 30px; 
    text-align: center;
}

/* ============================================= */
/* === RESPONSIVIDADE === */
/* ============================================= */

/* Responsividade dos eBooks (Grid) */
@media (max-width: 576px) {
    .ebook-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 577px) and (max-width: 992px) {
    .ebook-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 993px) {
    .ebook-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Media Query para Mobile */
@media (max-width: 991.98px) {
    .site-header {
        padding: 5px 0;
    }
    .header-main {
        display: none;
    }
    .header-account {
        display: none;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .header-top {
        margin-bottom: 0;
    }
    .header-logo img {
        height: 50px;
    }
    .mobile-header-icons {
        display: flex;
    }
}

/* Ajuste fino para selo "Em Breve" em telas pequenas */
@media (max-width: 480px) {
    .coming-soon-badge {
        padding: 6px;
        font-size: 10px;
    }
}

/* ============================================= */
/* === COMPONENTES ADICIONAIS === */
/* ============================================= */

/* Google Tradutor */
#google_translate_element {
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 4px;
}

.goog-te-combo {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 13px;
    height: 34px;
    box-sizing: border-box;
    vertical-align: middle;
    cursor: pointer;
}

/* Tag "Disponível em breve" */
.disponivel-em-breve-tag {
    display: inline-block;
    background-color: #6c757d;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1.2;
}

/* Botões Header */
.btn-signup-header, .btn-login-header, .btn-logout-header {
    padding: 7px 15px;
    border-radius: 20px;
    border: 1px solid white;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-signup-header {
    background-color: white;
    color: #FF4500 !important;
    font-weight: bold;
}
.btn-signup-header:hover {
    background-color: #f0f0f0;
    color: #d13a00 !important;
}
.btn-login-header {
    background-color: transparent;
}
.btn-login-header:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}
.btn-logout-header {
    background-color: rgba(255,255,255,0.15);
}
.btn-logout-header:hover {
    background-color: white;
    color: #800080 !important;
}
