/*
Theme Name: Livros Multimidia
Theme URI: https://multimidiaeducacional.com.br
Description: Portal de Livros PDF - Multimidia Educacional
Author: Multimidia Educacional
Author URI: https://multimidiaeducacional.com.br
Version: 1.0.0
Text Domain: livros-multimidia
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --dark-bg: #3e3862;
    --dark-destak: #332d52;
    --primary-blue: #062562;
    --link-blue: #5163f7;
    --info-blue: #353d9f;
    --success-green: #178524;
    --warning-yellow: #ffc900;
    --danger-red: #da133b;
    --card-hover: rgb(0, 157, 248);
    --font-family: 'Poppins', sans-serif;
    --white-ter: #f0f2f5;
    --grey: #707070;
    --body-text-color: #fff;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg) !important;
    font-family: var(--font-family);
    line-height: 1.6;
    font-size: 15px;
    color: var(--body-text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    color: var(--body-text-color);
}

span {
    color: var(--body-text-color);
}

.text-white {
    color: white
}

p {
    margin: 0 0 1rem;
}

.is-flex {
    display: flex !important;
}


/* ==========================================================================
   Layout
   ========================================================================== */
.section {
    padding: 3rem 1.5rem;
}

.section-mobile {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background-color: var(--dark-destak);
    border-bottom: 2px solid rgba(218, 220, 230, 0.1);
}

.site-header .container {
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem;
    gap: 1rem;
}

.site-logo img,
.custom-logo-link img,
.custom-logo {
    height: 60px;
    width: auto;
    display: block;
}

.site-logo img,
.custom-logo-link {
    margin-right: 1rem;
}

.site-branding {
    flex: 1;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.site-description {
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================================================
   Coleções
   ========================================================================== */
.colecao-section {
    margin-bottom: 2.5rem;
}

.colecao-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.colecao-header img {
    height: 26px;
    width: auto;
}

.colecao-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   Links de Material de Apoio
   ========================================================================== */
.material-apoio {
    margin-bottom: 1rem;
}

.material-apoio-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.material-apoio-label img {
    height: 16px;
}

.material-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    padding: 4px 12px;
    min-width: 70px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 1px rgba(0, 0, 0, 0.322);
    color: #fff;
}

.btn-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.btn-link img {
    height: 16px;
    width: auto;
}

.btn-creator4all {
    background: linear-gradient(90deg, #13a6d3 0%, #0672b9 100%);
}

.btn-google-drive {
    background: linear-gradient(90deg, #279745 0%, #0f4d9d 100%);
}

.btn-youtube {
    background: linear-gradient(90deg, #6009d1 0%, #e61717 100%);
}

.btn-pdf {
    background: linear-gradient(90deg, #2278e9 0%, #8824e6 100%);
}

/* Link personalizado */
.btn-custom {
    background: linear-gradient(90deg, #6009d1 0%, #e61717 100%);
}

.btn-custom:hover {
    filter: brightness(1.1);
}

.btn-icon-emoji {
    font-size: 1rem;
    line-height: 1;
}

.btn-icon-custom {
    height: 16px;
    width: auto;
    max-width: 24px;
    object-fit: contain;
}

/* ==========================================================================
   Grid de Livros
   ========================================================================== */
.livros-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

/* ==========================================================================
   Card de Livro
   ========================================================================== */
.livro-card {
    display: inline-block;
    padding: 0.5rem;
    background-color: var(--dark-destak);
    border-radius: 4px;
    transition: background-color 0.15s ease;
    max-width: 235px;
}

.livro-card:hover {
    background-color: var(--card-hover);
}

.livro-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
}

/* ==========================================================================
   Modal de Contato
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-card-head {
    background: var(--white-ter);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e1e1e1;
}

.modal-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--info-blue);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--grey);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-red);
}

.modal-card-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: #333;
}

.modal-card-foot {
    background: var(--white-ter);
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   Formulário
   ========================================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.form-label .required {
    color: var(--danger-red);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--link-blue);
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.form-row .form-control {
    flex: 1;
}

.form-row select.form-control {
    flex: 0 0 auto;
    width: auto;
    min-width: 180px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    margin-top: 0.25rem;
}

.form-check label {
    font-size: 0.9rem;
    color: #666;
}

.form-check a {
    color: var(--link-blue);
}

/* ==========================================================================
   Botões
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-success {
    background-color: var(--success-green);
    color: #fff;
}

.btn-success:hover {
    background-color: #136b1d;
}

.btn-cancel {
    background-color: #e1e1e1;
    color: #333;
}

.btn-cancel:hover {
    background-color: #ccc;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ==========================================================================
   Visualizador de Livro (iframe)
   ========================================================================== */
.livro-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 100;
}

/* ==========================================================================
   Alertas
   ========================================================================== */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(23, 133, 36, 0.1);
    border: 1px solid var(--success-green);
    color: var(--success-green);
}

.alert-error {
    background-color: rgba(218, 19, 59, 0.1);
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--dark-destak);
    text-align: center;
    color: var(--body-text-color);
    font-size: 0.9rem;
}
.site-footer p {
    display: initial
}

/* ==========================================================================
   Helpers
   ========================================================================== */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.text-center { text-align: center; }

.hr {
    border: none;
    border-top: 1px solid #e1e1e1;
    margin: 1rem 0;
}

.hidden {
    display: none !important;
}

.is-clipped {
    overflow: hidden !important;
}

/* Botão de link como button (Google Drive) */
button.btn-link {
    cursor: pointer;
    font-family: inherit;
}

/* Modal estilo Bulma */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.is-active {
    display: flex;
}

.modal-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.342);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    overflow: auto;
}

.modal-close {
    background: rgba(10, 10, 10, 0.2);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    pointer-events: auto;
    display: inline-block;
    position: fixed;
    right: 30px;
    top: 30px;
    height: 32px;
    width: 32px;
    outline: 0;
    user-select: none;
}

.modal-close.is-large {
    height: 40px;
    width: 40px;
}

.modal-close::before,
.modal-close::after {
    background-color: #fff;
    content: "";
    display: block;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    transform-origin: center center;
}

.modal-close::before {
    height: 2px;
    width: 50%;
}

.modal-close::after {
    height: 50%;
    width: 2px;
}

.modal-close:hover {
    background-color: rgba(10, 10, 10, 0.3);
}

/* Classes auxiliares Bulma */
.has-background-white {
    background-color: #fff !important;
}

.has-text-grey {
    color: #707070 !important;
}

.is-size-5 {
    font-size: 1.25rem !important;
}

@media screen and (max-width: 768px) {
    .is-size-6-mobile {
        font-size: 1rem !important;
    }
}

.p-5 {
    padding: 1.5rem !important;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button.is-success {
    background-color: #178524;
    border-color: transparent;
    color: #fff;
}

.button.is-success:hover {
    background-color: #10791c;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1024px) {
    .livro-card {
        max-width: calc(20% - 1rem);
    }
}

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .site-logo {
        margin-bottom: 0.5rem;
    }
    
    .livros-grid {
        gap: 0.75rem;
    }
    
    .livro-card {
        max-width: calc(50% - 0.375rem);
        padding: 0.375rem;
    }
    
    .section {
        padding: 1.5rem 1rem;
    }
    
    .colecao-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.25rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row select.form-control {
        width: 100%;
    }
}
