:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #9e9e9e;
    --accent: #00d2ff;
    --border: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

/* =========================================
   NAVBAR FIXA (CORRIGIDA)
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(18, 18, 18, 0.98); /* Fundo quase sólido */
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000; /* FIX: Força a navbar a ficar ACIMA do leitor */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: -0.5px;
}

/* =========================================
   BARRA DE BUSCA (CLEAN)
========================================= */
input#search-input, input#devkindle-title-input {
    border: 1px solid var(--border);
    background: #2a2a2a;
    color: var(--text-main);
    border-radius: 6px; /* Bordas levemente quadradas */
    padding: 0.6rem 1rem;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
}

input#search-input:focus, input#devkindle-title-input:focus {
    border-color: #555;
    background: #333;
}

/* =========================================
   LAYOUT E CARDS DE LIVROS
========================================= */
.container {
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Card Estilo Minimalista */
.book-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: #555;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.book-cover-placeholder {
    height: 160px;
    background: linear-gradient(145deg, #2a2a2a, #222);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    border: 1px solid #333;
}

.book-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

/* Tags Limpas */
.badge-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* =========================================
   NAVEGAÇÃO DE CATEGORIAS
========================================= */
.category-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    width: 100%;
}

.carousel-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 4px; /* Mantendo o estilo quadrado funcional */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0; /* Impede que o botão seja esmagado */
}

.carousel-btn:hover {
    background: #333;
    border-color: #555;
}

.carousel-btn:active {
    transform: scale(0.95);
}

.category-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-grow: 1; /* Faz a barra ocupar todo o espaço restante */
    scroll-behavior: smooth;
    
    /* Esconder a barra de rolagem mas manter a funcionalidade */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.category-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap; /* Impede a quebra de linha do texto do botão */
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.category-btn:hover {
    border-color: #666;
    color: var(--text-main);
}

.category-btn.active {
    background: #e0e0e0;
    color: #121212;
    border-color: #e0e0e0;
    font-weight: 600;
}
.friendly-notice {
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.friendly-notice .material-symbols-rounded {
    color: var(--accent);
    font-size: 24px;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 5%;
    margin-top: 4rem;
    background: #151515;
    text-align: center;
}

.footer-content a { color: var(--text-main); text-decoration: none; transition: color 0.2s;}
.footer-content a:hover { color: var(--accent); }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 15px; flex-wrap: wrap; }
.footer-links a, .btn-pix { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.btn-pix { background: transparent; color: #ffb703; border: 1px solid rgba(255, 183, 3, 0.4); padding: 6px 12px; border-radius: 4px; }
.btn-pix:hover { background: rgba(255, 183, 3, 0.1); border-color: #ffb703; }

/* =========================================
   MODAL PIX
========================================= */
.pix-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); justify-content: center; align-items: center;
}
.pix-modal-content {
    background-color: var(--bg-card); margin: auto; padding: 30px; border: 1px solid var(--border);
    border-radius: 12px; width: 90%; max-width: 400px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.close-modal { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: #fff; }

/* =========================================
   ESTILOS NOVOS DA HOME (Histórico, Botões)
========================================= */
.btn-start-huge {
    background: var(--accent); color: #000; font-weight: bold; padding: 12px 30px; 
    font-size: 1.1rem; border-radius: 50px; margin-top: 1.5rem; display: inline-flex;
}
.btn-start-huge:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }

.github-repo-link {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    background: #222; color: #aaa; text-decoration: none; padding: 6px; border-radius: 4px;
    font-size: 0.8rem; margin-top: auto; border: 1px solid #333; transition: 0.2s;
}
.github-repo-link:hover { background: #333; color: #fff; border-color: #555; }

.special-section { margin-bottom: 3rem; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin-bottom: 5px; }
.section-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.section-divider { border: 0; border-top: 1px solid #333; margin: 3rem 0; }
.select-category-prompt { text-align: center; padding: 2rem; background: #1a1a1a; border-radius: 8px; border: 1px dashed #444; }

/* Card History Customizado */
.history-card { border-color: var(--accent); background: linear-gradient(180deg, #1e1e1e, #111); justify-content: space-between; }
.progress-bar-bg { background: #333; width: 100%; height: 4px; border-radius: 2px; margin-bottom: 10px; }
.progress-bar-fill { background: var(--accent); height: 100%; border-radius: 2px; box-shadow: 0 0 5px var(--accent); }
.resume-badge { background: rgba(0, 210, 255, 0.1); color: var(--accent); font-size: 0.75rem; text-align: center; padding: 4px; border-radius: 4px; font-weight: bold; }
/* Em telas muito pequenas (celular), podemos esconder as setas, já que lá é natural passar o dedo */
@media (max-width: 600px) {
    .carousel-btn {
        display: none;
    }
}
.badge.beginner { background-color: rgba(46, 125, 50, 0.2); color: #81c784; border: 1px solid rgba(46, 125, 50, 0.5); }
.badge.advanced { background-color: rgba(198, 40, 40, 0.2); color: #e57373; border: 1px solid rgba(198, 40, 40, 0.5); }