/* reader.css - Tema Verde Linhas Curvas */

:root {
    --primary-green: #2ecc71;
    --primary-green-hover: #27ae60;
    --dark-bg: #0f0f0f;
    --surface-bg: #1a1a1a;
    --surface-lighter: #2a2a2a;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333;
    --danger: #e74c3c;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* Estrutura do Leitor */
.reader-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-green);
    text-decoration: none;
    transition: 0.2s;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Header da Comic */
.comic-header {
    text-align: center;
    margin-bottom: 30px;
}

.comic-header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 800;
}

.author-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

/* Visualizador Principal */
.viewer-container {
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

/* Suporte a Scroll em Tela Cheia - CORRIGIDO */
#fullscreen-target:fullscreen {
    overflow-y: auto !important;
    background: #000;
    display: block; 
    padding: 20px 0; /* Espaçamento para a imagem não colar no topo */
}

/* Centralização da Comic em Tela Cheia */
#fullscreen-target:fullscreen .comic-wrapper {
    margin: 0 auto; /* Isso centraliza horizontalmente no modo block */
    display: block;
    width: 80%; /* Ou a largura que você preferir no fullscreen */
}

#fullscreen-target:fullscreen #comic-img {
    margin: 0 auto;
    max-width: 100%;
    display: block;
}

/* Garante que os controles fiquem fixos sobre a imagem no scroll */
#fullscreen-target:fullscreen .viewer-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.comic-wrapper {
    width: 80%;
    transition: width 0.3s ease;
}

#comic-img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

/* Zonas de Clique */
.click-zone {
    position: absolute;
    top: 0;
    height: 100%;
    width: 25%;
    cursor: pointer;
    z-index: 5;
}
.click-zone.left { left: 0; }
.click-zone.right { right: 0; }

/* Controles Flutuantes */
.viewer-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 10px 25px;
    border-radius: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 100;
    border: 1px solid rgba(46, 204, 113, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.viewer-container:hover .viewer-controls {
    opacity: 1;
    visibility: visible;
}

.zoom-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctrl-btn, .fullscreen-btn {
    background: var(--surface-lighter);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.ctrl-btn:hover, .fullscreen-btn:hover {
    background: var(--primary-green);
    color: #000;
}

#zoom-percent {
    font-family: monospace;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.page-indicator {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-green);
}

/* Miniaturas */
.pages-preview {
    margin: 25px 0;
    padding: 10px;
    background: var(--surface-bg);
    border-radius: 8px;
}

.thumb-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px;
}

.thumb-track img {
    height: 100px;
    width: auto;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.4;
    transition: 0.3s;
    border: 2px solid transparent;
}

.thumb-track img.active,
.thumb-track img:hover {
    opacity: 1;
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

/* Seção de Informações */
.comic-info-section {
    background: var(--surface-bg);
    padding: 30px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

/* Tags Corrigidas */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.tag-chip {
    background: var(--surface-lighter);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Sistema de Votos */
.vote-container {
    display: flex;
    align-items: center;
    background: var(--surface-lighter);
    padding: 5px 15px;
    border-radius: 30px;
    gap: 10px;
}

.vote-container button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.vote-container button:hover { color: var(--text-main); }

#btn-upvote.active { color: var(--primary-green); transform: scale(1.2); }
#btn-downvote.active { color: var(--danger); transform: scale(1.2); }

#vote-score {
    font-weight: 800;
    color: var(--text-main);
    min-width: 25px;
    text-align: center;
}

/* Botões de Ação */
.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: 0.2s;
}

.fav-btn.active {
    background: var(--danger);
    border-color: var(--danger);
}

.action-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

/* Descrição e Ler Mais */
.description-container {
    margin-top: 20px;
}

.description-container h3 {
    color: var(--primary-green);
    margin-bottom: 12px;
}

.description-text {
    line-height: 1.7;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.4s ease;
    white-space: pre-wrap;
}

.description-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

#btn-read-more {
    background: none;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    font-weight: 700;
    padding: 10px 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

#btn-read-more:hover {
    color: var(--primary-green-hover);
    text-decoration: underline;
}

/* Comentários Centralizados */
.voting-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.vote-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--surface-bg);
    border: 1px solid var(--primary-green);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 480px;
}

.modal-content h3 { color: var(--danger); margin-bottom: 20px; }

.modal-content select, 
.modal-content textarea {
    width: 100%;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0 20px;
}

.modal-content textarea { height: 120px; resize: none; }

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-cancel { background: transparent; border: none; color: white; cursor: pointer; }
.btn-confirm {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Container das notificações */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    border-left: 5px solid #27ae60; /* Verde do Traço Livre */
}

.toast.error {
    border-left-color: #e74c3c; /* Vermelho para erros/negação */
}

.toast i {
    font-size: 1.2rem;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Feedback do Report */
.success-msg { color: var(--primary-green); background: rgba(46, 204, 113, 0.1); padding: 10px; border-radius: 4px; }
.error-msg { color: var(--danger); background: rgba(231, 76, 60, 0.1); padding: 10px; border-radius: 4px; }

/* Responsividade */
@media (max-width: 768px) {
    .comic-wrapper { width: 100% !important; }
    .viewer-controls { 
        width: 90%; 
        min-width: auto;
        padding: 8px 15px;
    }
    .info-header { flex-direction: column; align-items: center; text-align: center; }
    .action-buttons { width: 100%; justify-content: center; }
    .tags-container { justify-content: center; }
}