/* ==========================================================
   VARIÁVEIS GLOBAIS
   ========================================================== */
:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #0ea5e9;
    --accent: #0284c7;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f0f9ff;
    --bg-white: #ffffff;
    --border: #dbeafe;
}

/* ==========================================================
   RESET BÁSICO
   ========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(to bottom, #ffffff, #f0f9ff);
}

.serif-font {
    font-family: 'Playfair Display', serif;
}

/* ==========================================================
   SCROLL SUAVE E PERSONALIZADO
   ========================================================== */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* ==========================================================
   BOTÕES
   ========================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.3);
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    padding: 12px 28px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
    text-decoration: none;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

/* ==========================================================
   CARDS E CONTEÚDOS
   ========================================================== */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.15);
    transform: translateY(-2px);
}

/* ==========================================================
   EFEITO 3D NA CAPA DO LIVRO
   ========================================================== */
.book-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.book-3d:hover {
    transform: rotateY(-10deg) rotateX(5deg);
}

.book-cover {
    transform-style: preserve-3d;
    transition: transform 0.6s;
    box-shadow:
        0 10px 40px rgba(30, 64, 175, 0.3),
        inset 0 0 30px rgba(30, 64, 175, 0.1);
}

/* ==========================================================
   ABAS (TABS)
   ========================================================== */
.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-button:hover {
    color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   AVALIAÇÕES E ESTRELAS
   ========================================================== */
.star-rating {
    display: inline-flex;
    gap: 2px;
}

.star {
    color: #fbbf24;
    font-size: 16px;
}

.star.empty {
    color: #e5e7eb;
}

/* ==========================================================
   FORMATOS E PILLS
   ========================================================== */
.format-pill {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-pill:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.format-pill.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==========================================================
   SIDEBAR FIXA
   ========================================================== */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* ==========================================================
   BARRA DE PROGRESSO
   ========================================================== */
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ==========================================================
   LISTA DE CAPÍTULOS
   ========================================================== */
.chapter-item {
    padding: 16px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-item:hover {
    background: var(--bg-light);
    border-left-color: var(--primary);
}

.chapter-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================
   CARTÕES DE AVALIAÇÃO
   ========================================================== */
.review-card {
    padding: 20px;
    border-radius: 12px;
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.review-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
}

/* ==========================================================
   LIVROS RELACIONADOS
   ========================================================== */
.related-book {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
}

.related-book img {
    transition: transform 0.3s ease;
}

.related-book:hover img {
    transform: scale(1.05);
}

.related-book-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(30, 64, 175, 0.9), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.related-book:hover .related-book-overlay {
    transform: translateY(0);
}

/* ==========================================================
   MENU MOBILE
   ========================================================== */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }

    .desktop-menu {
        display: none;
    }
}

/* ==========================================================
   ANIMAÇÃO DE CARREGAMENTO
   ========================================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================
   BOTÃO FLUTUANTE DE SUPORTE
   ========================================================== */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

/* Versão mobile do botão flutuante */
@media (max-width: 768px) {
    .fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .fab i {
        font-size: 20px;
    }
}

/* ==========================================================
   SELOS E ÍCONES DE FORMATO
   ========================================================== */
.hotmart-badge {
    background: linear-gradient(135deg, #ff3b30, #ff6b6b);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.format-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}
