* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== FONDO ANIMADO CON BURBUJAS ========== */
body {
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Contenedor del fondo animado */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Burbujas grandes */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(3px);
    animation: floatBubble 12s infinite ease-in-out;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

@keyframes floatBubble {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
        transform: translateY(50vh) scale(1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-20vh) scale(0.8);
        opacity: 0;
    }
}

/* Burbujas pequeñas */
.bubble-small {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(2px);
    animation: floatSmall 8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes floatSmall {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-20vh) scale(1.2);
        opacity: 0;
    }
}

/* Partículas flotantes */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 15s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

/* Olas decorativas */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" fill-opacity="1" d="M0,192L48,197.3C96,203,192,213,288,208C384,203,480,181,576,181.3C672,181,768,203,864,213.3C960,224,1056,224,1152,213.3C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') repeat-x;
    background-size: cover;
    animation: waveMove 10s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes waveMove {
    0% {
        background-position-x: 0;
    }
    100% {
        background-position-x: 1440px;
    }
}

/* ========== CONTENIDO PRINCIPAL ========== */
.navbar-custom {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar-custom:hover {
    background: rgba(0, 0, 0, 0.4);
}

.hero-section {
    position: relative;
    padding: 80px 0;
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== TARJETAS DE LIBROS ========== */
.books-grid {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.book-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: white;
}

.book-cover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    padding: 40px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.book-card:hover .book-cover {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.book-cover i {
    font-size: 80px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover i {
    transform: scale(1.1);
}

.book-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-author i {
    margin-right: 5px;
    font-size: 0.8rem;
}

.book-description {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* ========== FILTROS ========== */
.filters-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.filters-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    padding-left: 40px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========== VISOR DE PDF MEJORADO ========== */
.pdf-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    flex-direction: column;
    animation: fadeInModal 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pdf-toolbar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-title {
    font-size: 1.1rem;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.pdf-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.pdf-controls button:active {
    transform: translateY(0);
}

.pdf-controls input {
    width: 70px;
    padding: 8px;
    border-radius: 10px;
    border: none;
    text-align: center;
    font-weight: 500;
}

.pdf-container {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Transiciones suaves para el canvas */
#pdfCanvas {
    display: block;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Animación de cambio de página mejorada */
.page-transition {
    animation: pageSmoothFlip 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageSmoothFlip {
    0% {
        opacity: 0.3;
        transform: perspective(1000px) rotateY(15deg) scale(0.96);
    }
    50% {
        opacity: 0.7;
        transform: perspective(1000px) rotateY(5deg) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateY(0deg) scale(1);
    }
}

/* Animación de zoom suave */
.zoom-transition {
    animation: zoomSmooth 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomSmooth {
    0% {
        opacity: 0.6;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
}

.pdf-loading i {
    animation: spinSmooth 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    font-size: 50px;
    margin-bottom: 15px;
}

@keyframes spinSmooth {
    from {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

.close-viewer {
    background: #dc3545 !important;
}

.close-viewer:hover {
    background: #c82333 !important;
}

/* Capa de enlaces */
.pdf-interactive-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.pdf-link-area {
    position: absolute;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-radius: 4px;
}

.pdf-link-area.url-link {
    background: rgba(0, 123, 255, 0.15);
    border: 1px solid rgba(0, 123, 255, 0.4);
}

.pdf-link-area.url-link:hover {
    background: rgba(0, 123, 255, 0.35);
    border: 1px solid rgba(0, 123, 255, 0.8);
}

.pdf-link-area.email-link {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.pdf-link-area.email-link:hover {
    background: rgba(40, 167, 69, 0.35);
    border: 1px solid rgba(40, 167, 69, 0.8);
}

.pdf-link-area.paypal-link {
    background: rgba(0, 156, 222, 0.15);
    border: 1px solid rgba(0, 156, 222, 0.4);
}

.pdf-link-area.paypal-link:hover {
    background: rgba(0, 156, 222, 0.35);
    border: 1px solid rgba(0, 156, 222, 0.8);
}

.pdf-link-area.social-link {
    background: rgba(111, 66, 193, 0.15);
    border: 1px solid rgba(111, 66, 193, 0.4);
}

.pdf-link-area.social-link:hover {
    background: rgba(111, 66, 193, 0.35);
    border: 1px solid rgba(111, 66, 193, 0.8);
}

.pdf-link-area.phone-link {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.pdf-link-area.phone-link:hover {
    background: rgba(255, 193, 7, 0.35);
    border: 1px solid rgba(255, 193, 7, 0.8);
}

/* Tooltip de enlaces */
.link-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: tooltipFadeIn 0.2s ease-out;
    border-left: 3px solid;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-tooltip.url-tooltip {
    border-left-color: #007bff;
}

.link-tooltip.email-tooltip {
    border-left-color: #28a745;
}

.link-tooltip.paypal-tooltip {
    border-left-color: #009cde;
}

.link-tooltip.social-tooltip {
    border-left-color: #6f42c1;
}

.link-tooltip.phone-tooltip {
    border-left-color: #ffc107;
}

/* Indicador de página */
.page-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Notificación de zoom */
.zoom-toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    pointer-events: none;
    animation: zoomToastFade 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

@keyframes zoomToastFade {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }
    15% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }
}

/* Reproductor de música */
.music-player-fixed {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#musicToggle {
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

#musicToggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Animaciones de tarjetas */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-item {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.book-item:nth-child(1) {
    animation-delay: 0.05s;
}

.book-item:nth-child(2) {
    animation-delay: 0.1s;
}

.book-item:nth-child(3) {
    animation-delay: 0.15s;
}

.book-item:nth-child(4) {
    animation-delay: 0.2s;
}

.book-item:nth-child(5) {
    animation-delay: 0.25s;
}

.book-item:nth-child(6) {
    animation-delay: 0.3s;
}

.book-item:nth-child(7) {
    animation-delay: 0.35s;
}

.book-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Botón de scroll to top */
.scroll-top {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    background: white;
}

/* Contador de enlaces */
.links-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .pdf-toolbar {
        flex-direction: column;
    }
    .pdf-title {
        white-space: normal;
        text-align: center;
    }
    .pdf-controls {
        justify-content: center;
    }
    .music-player-fixed {
        bottom: 15px;
        right: 15px;
    }
    #musicToggle {
        padding: 8px 16px;
        font-size: 12px;
    }
    .book-title {
        font-size: 1rem;
    }
    .link-tooltip {
        font-size: 10px;
        max-width: 250px;
        white-space: normal;
        word-break: break-all;
    }
}

/* Efecto de vidrio esmerilado */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}