/* ==========================================
   MODAL DE CAPÍTULOS
   ========================================== */

.modal-capitulos-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-capitulos-wrapper.abrindo,
.modal-capitulos-wrapper.aberto,
.modal-capitulos-wrapper.fechando {
    display: flex;
}

.modal-capitulos-container {
    background: #050505;
    border: 2px solid #00ffcc;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 0;
    height: 0;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
}

.modal-capitulos-wrapper.abrindo .modal-capitulos-container {
    animation: ponto 0.2s forwards, linha 0.2s 0.2s forwards, quadrado 0.25s 0.4s forwards, expandir 0.3s 0.65s forwards;
}

@keyframes ponto {
    0% { width: 0; height: 0; opacity: 0; }
    100% { width: 8px; height: 8px; border-radius: 50%; opacity: 1; }
}
@keyframes linha {
    0% { width: 8px; height: 8px; border-radius: 50%; }
    100% { width: 200px; height: 2px; border-radius: 0; }
}
@keyframes quadrado {
    0% { width: 200px; height: 2px; }
    100% { width: 200px; height: 120px; }
}
@keyframes expandir {
    0% { width: 200px; height: 120px; }
    100% { width: 650px; height: auto; min-height: 450px; max-height: 85vh; }
}

.modal-capitulos-wrapper.aberto .modal-capitulos-container {
    width: 650px;
    height: auto;
    min-height: 450px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-capitulos-wrapper.fechando .modal-capitulos-container {
    animation: encolher 0.3s forwards, quadradoInv 0.25s 0.3s forwards, linhaInv 0.2s 0.55s forwards, pontoInv 0.2s 0.75s forwards;
}

@keyframes encolher {
    0% { width: 650px; height: auto; min-height: 450px; max-height: 85vh; }
    100% { width: 200px; height: 120px; }
}
@keyframes quadradoInv {
    0% { width: 200px; height: 120px; }
    100% { width: 200px; height: 2px; }
}
@keyframes linhaInv {
    0% { width: 200px; height: 2px; }
    100% { width: 8px; height: 8px; border-radius: 50%; }
}
@keyframes pontoInv {
    0% { width: 8px; height: 8px; opacity: 1; }
    100% { width: 0; height: 0; opacity: 0; }
}

.modal-capitulos-container::-webkit-scrollbar {
    width: 4px;
}
.modal-capitulos-container::-webkit-scrollbar-track {
    background: #0a0a0a;
}
.modal-capitulos-container::-webkit-scrollbar-thumb {
    background: #00ffcc;
    border-radius: 4px;
}

.btn-fechar-modal-capitulos {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    width: 38px;
    height: 38px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 4px;
    transition: 0.3s;
}
.btn-fechar-modal-capitulos:hover {
    background: #ff4d4d;
    color: #000;
}

.modal-capitulos-header h2 {
    color: #00ffcc;
    text-align: center;
    padding: 20px 20px 0;
    margin: 0;
}

.modal-capitulos-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-capitulos-body::-webkit-scrollbar {
    width: 6px;
}
.modal-capitulos-body::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}
.modal-capitulos-body::-webkit-scrollbar-thumb {
    background: #00ffcc;
    border-radius: 4px;
}

.modal-capitulos-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid #1a1a1a;
}
.btn-capitulos-nav {
    background: transparent;
    border: 1px solid #00ffcc;
    color: #00ffcc;
    padding: 8px 20px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-capitulos-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}