/* ================================================================
   Leitor SX — Estilos
   ================================================================ */

/* ---------- Lista de PDFs ---------- */

.leitor-sx-titulo {
    margin-bottom: .75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.leitor-sx-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.leitor-sx-item {
    margin: 0;
    padding: 0;
}

.leitor-sx-link {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .65rem;
    border-radius: 6px;
    color: #1a73e8;
    text-decoration: none;
    font-size: .97rem;
    transition: background .15s ease, color .15s ease;
    cursor: pointer;
}

.leitor-sx-link::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a73e8'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.leitor-sx-link:hover,
.leitor-sx-link:focus-visible {
    background: #e8f0fe;
    color: #1558b0;
    outline: none;
}

.leitor-sx-vazio {
    color: #888;
    font-style: italic;
}

/* ---------- Overlay / Backdrop ---------- */

.leitor-sx-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    /* animação de entrada */
    opacity: 0;
    transition: opacity .2s ease;
}

.leitor-sx-overlay:not([hidden]) {
    opacity: 1;
}

/* hidden via atributo HTML — esconde sem display:none para animação */
.leitor-sx-overlay[hidden] {
    display: none !important;
}

/* ---------- Modal ---------- */

.leitor-sx-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    width: min(900px, 96vw);
    height: min(88vh, 860px);
    overflow: hidden;
    /* animação de entrada */
    transform: scale(.96);
    transition: transform .2s ease;
}

.leitor-sx-overlay:not([hidden]) .leitor-sx-modal {
    transform: scale(1);
}

/* ---------- Cabeçalho do Modal ---------- */

.leitor-sx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    gap: 1rem;
    flex-shrink: 0;
}

.leitor-sx-modal-nome {
    font-size: .95rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leitor-sx-fechar {
    all: unset;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #555;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}

.leitor-sx-fechar:hover,
.leitor-sx-fechar:focus-visible {
    background: #e0e0e0;
    color: #111;
    outline: none;
}

/* ---------- Área do Viewer ---------- */

.leitor-sx-viewer-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.leitor-sx-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ---------- Responsividade ---------- */

@media (max-width: 600px) {
    .leitor-sx-modal {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .leitor-sx-overlay {
        padding: 0;
        align-items: flex-start;
    }
}
