/* ===== Estructura general ===== */

html,
body {
    height: 100%;
    margin: 0;
    font-family: sans-serif;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: #222;
    background-image: url('fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


/* ===== Viewer ===== */

.viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}


/* ===== Revista ===== */

.magazine {
    width: 90vw;
    max-width: 1200px;
    height: 70vh;
    max-height: 900px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.page-img {
    border: 3px solid #000;
    background: white;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}


/* ===== Fullscreen ===== */

.fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
}


/* Botón flotante para salir del expandido */

.exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.exit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ===== Controles ===== */

.controls {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

button {
    padding: 8px 12px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ===== Sidebar índice ===== */

#sidebar-index {
    position: absolute;
    right: 0;
    top: 0;
    width: 220px;
    max-height: 100%;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0);
    padding: 10px;
    box-sizing: border-box;
}

#sidebar-index button {
    width: 100%;
    margin: 3px 0;
    text-align: left;
    background: rgba(50, 50, 50, 0.8);
}

#sidebar-index button.active {
    background: #444;
    font-weight: bold;
}


/* ===== Footer ===== */

.footer {
    background: rgba(17, 17, 17, 0.8);
    color: #ccc;
    text-align: center;
    padding: 10px;
    font-size: 0.9em;
    width: 100%;
    border-top: 2px solid #333;
    backdrop-filter: blur(6px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}


/* Redes */

.social-links a {
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 12px;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-ig {
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    border: 2px solid black;
}

.btn-tw {
    background: #111;
    border: 2px solid white;
}

.btn-lt {
    background: #39e09b;
    color: black;
    border: 2px solid black;
}

.icon {
    width: 24px;
    height: 24px;
}

.icon-inline {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}


/* ===== Media Queries ===== */

@media (max-width: 1024px) {
    #sidebar-index {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .magazine {
        flex-direction: column;
        height: auto;
    }
    .page-img {
        width: 90vw;
        height: auto;
        margin-bottom: 10px;
    }
    #sidebar-index {
        position: relative;
        width: 100%;
        max-height: 200px;
        margin-top: 10px;
    }
    button {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}


/* ===== Overlay del Índice ===== */

#index-overlay.hidden {
    display: none;
}

#index-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#index-panel {
    background: rgba(20, 20, 20, 0.9);
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    border: 2px solid #555;
}

#index-list button {
    width: 100%;
    margin: 6px 0;
    padding: 10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#index-list button:hover {
    background: #555;
}

.close-btn {
    margin-top: 10px;
    background: #800;
    font-weight: bold;
}

#page-indicator {
    text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
}

.enoko-link {
    color: inherit;
    /* usa el mismo color del texto */
    text-decoration: none;
    /* sin subrayado */
    font-weight: inherit;
    /* mantiene estilo actual */
    display: inline-flex;
    /* mantiene alineación icono-texto */
    align-items: center;
    gap: 5px;
    /* pequeño espacio entre texto e icono */
}

.enoko-link:hover {
    opacity: 0.8;
    /* leve efecto hover, opcional */
}