/* Estilos de libro.php para presentacion del libvro del Himnos del evangelio eterno */
        :root {
            --primary-dark: #341D14;
            --gold: #D4AF37;
            --beige: #D2AA7E;
            --cream: #FDF8F3;
            --cream-dark: #F5EDE4;
            --text-dark: #2C1810;
            --text-light: #F5EDE4;
            --sidebar-width: 340px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Montserrat', sans-serif;
            background: var(--cream);
            display: flex;
            height: 100vh;
            overflow: hidden;
            color: var(--text-dark);
        }

        /* ==================== SIDEBAR ==================== */
        #sidebar {
            width: var(--sidebar-width);
            background: linear-gradient(180deg, var(--primary-dark) 0%, #2A1610 100%);
            color: var(--text-light);
            display: flex;
            flex-direction: column;
            box-shadow: 4px 0 20px rgba(52, 29, 20, 0.3);
            z-index: 100;
            position: relative;
            transition: var(--transition);
        }

        .sidebar-header {
            padding: 30px 25px;
            background: linear-gradient(135deg, var(--primary-dark) 0%, #1F110C 100%);
            text-align: center;
            border-bottom: 2px solid var(--gold);
            position: relative;
        }

        .sidebar-header::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 50%;
            transform: translateX(-50%);
            width: 60px;
            height: 4px;
            background: var(--gold);
            border-radius: 2px;
        }

        .logo-icon {
            width: 85px;
            height: 85px;
            margin: 0 auto 15px;
            background: #ffffff;
            border: 3px solid var(--gold);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
            overflow: hidden;
            transition: var(--transition);
        }

        .logo-icon:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
        }

        .logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 10px;
        }

        .sidebar-header h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--gold);
            line-height: 1.4;
            letter-spacing: 0.5px;
        }

        .sidebar-header span {
            display: block;
            font-family: 'Montserrat', sans-serif;
            font-size: 0.75rem;
            color: var(--beige);
            margin-top: 8px;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        .search-container {
            padding: 20px;
            background: rgba(0,0,0,0.15);
        }

        .search-wrapper {
            position: relative;
        }

        #search-input {
            width: 100%;
            padding: 14px 20px 14px 50px;
            border-radius: 30px;
            border: 2px solid transparent;
            background: rgba(255,255,255,0.08);
            color: var(--text-light);
            font-family: 'Montserrat', sans-serif;
            font-size: 0.9rem;
            outline: none;
            transition: var(--transition);
        }

        #search-input::placeholder {
            color: var(--beige);
            opacity: 0.6;
        }

        #search-input:focus {
            border-color: var(--gold);
            background: rgba(255,255,255,0.12);
            box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
        }

        .search-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gold);
            font-size: 18px;
        }

        #index-list {
            flex: 1;
            overflow-y: auto;
            list-style: none;
            padding: 10px 0;
            scrollbar-width: thin;
            scrollbar-color: var(--gold) var(--primary-dark);
        }

        #index-list::-webkit-scrollbar {
            width: 6px;
        }

        #index-list::-webkit-scrollbar-track {
            background: var(--primary-dark);
        }

        #index-list::-webkit-scrollbar-thumb {
            background: var(--gold);
            border-radius: 3px;
        }

        #index-list li {
            padding: 16px 25px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.1);
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        #index-list li::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 3px;
            height: 100%;
            background: var(--gold);
            transform: scaleY(0);
            transition: var(--transition);
        }

        #index-list li:hover {
            background: rgba(212, 175, 55, 0.1);
            padding-left: 30px;
        }

        #index-list li:hover::before {
            transform: scaleY(1);
        }

        #index-list li.active {
            background: linear-gradient(90deg, var(--gold) 0%, var(--beige) 100%);
            color: var(--primary-dark);
            font-weight: 600;
        }

        #index-list li.active::before {
            transform: scaleY(1);
            background: var(--primary-dark);
        }

        .hymn-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 36px;
            height: 36px;
            background: rgba(212, 175, 55, 0.2);
            border-radius: 50%;
            margin-right: 15px;
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--gold);
            transition: var(--transition);
        }

        #index-list li.active .hymn-number {
            background: var(--primary-dark);
            color: var(--gold);
        }

        /* ==================== MOBILE MENU TOGGLE ==================== */
        .menu-toggle {
            display: none;
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 200;
            width: 50px;
            height: 50px;
            background: var(--primary-dark);
            border: 2px solid var(--gold);
            border-radius: 50%;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(52, 29, 20, 0.4);
            transition: var(--transition);
        }

        .menu-toggle:hover {
            background: var(--gold);
        }

        .menu-toggle span {
            display: block;
            width: 22px;
            height: 2px;
            background: var(--gold);
            margin: 4px 0;
            transition: var(--transition);
        }

        .menu-toggle:hover span {
            background: var(--primary-dark);
        }

        .menu-toggle.active span:nth-child(1) {
            transform: rotate(45deg) translate(5px, 5px);
        }

        .menu-toggle.active span:nth-child(2) {
            opacity: 0;
        }

        .menu-toggle.active span:nth-child(3) {
            transform: rotate(-45deg) translate(5px, -5px);
        }

        .overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(52, 29, 20, 0.7);
            z-index: 90;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .overlay.active {
            display: block;
            opacity: 1;
        }

        /* ==================== MAIN VIEWER ==================== */
        #main-viewer {
            flex: 1;
            overflow-y: auto;
            padding: 50px;
            display: flex;
            justify-content: center;
            scroll-behavior: smooth;
            background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
        }

        .content-card {
            max-width: 750px;
            width: 100%;
            background: white;
            padding: 60px 70px;
            border-radius: 8px;
            box-shadow: 
                0 10px 40px rgba(52, 29, 20, 0.1),
                0 0 0 1px rgba(212, 175, 55, 0.1);
            min-height: fit-content;
            position: relative;
        }

        .content-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(90deg, var(--primary-dark), var(--gold), var(--beige), var(--gold), var(--primary-dark));
            border-radius: 8px 8px 0 0;
        }

        /* ==================== WELCOME MESSAGE ==================== */
        #welcome-msg {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 80px 40px;
        }

        .welcome-icon {
            width: 140px;
            height: 140px;
            background: #ffffff;
            border: 4px solid var(--gold);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 30px;
            box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
            animation: pulse-logo 3s ease-in-out infinite;
            overflow: hidden;
        }

        .welcome-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 15px;
        }

        @keyframes pulse-logo {
            0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3); }
            50% { transform: translateY(-8px) scale(1.02); box-shadow: 0 15px 40px rgba(212, 175, 55, 0.5); }
        }

        .welcome-title {
            font-family: 'Playfair Display', serif;
            font-size: 2rem;
            color: var(--primary-dark);
            margin-bottom: 15px;
        }

        .welcome-subtitle {
            font-size: 1rem;
            color: var(--beige);
            max-width: 400px;
        }

        /* ==================== HYMN CONTENT ==================== */
        .versiculo-header {
            text-align: center;
            margin-bottom: 40px;
            padding-bottom: 30px;
            border-bottom: 2px solid var(--cream-dark);
            position: relative;
        }

        .versiculo-header::after {
            content: '✦';
            position: absolute;
            bottom: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            padding: 0 15px;
            color: var(--gold);
            font-size: 18px;
        }

        .versiculo-header h1 {
            font-family: 'Playfair Display', serif;
            font-size: 2.2rem;
            font-weight: 600;
            color: var(--primary-dark);
            line-height: 1.3;
        }

        .versiculo-header .hymn-badge {
            display: inline-block;
            background: linear-gradient(135deg, var(--gold) 0%, var(--beige) 100%);
            color: var(--primary-dark);
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 15px;
            letter-spacing: 1px;
        }

        /* ==================== AUDIO PLAYER ==================== */
        .audio-player-zone {
            margin: 30px 0;
            background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
            padding: 25px;
            border-radius: 15px;
            border: 1px solid rgba(212, 175, 55, 0.2);
        }

        .audio-label {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
            font-size: 0.9rem;
            color: var(--primary-dark);
            font-weight: 500;
        }

        .audio-label svg {
            color: var(--gold);
        }

        audio {
            width: 100%;
            height: 45px;
            border-radius: 25px;
        }

        audio::-webkit-media-controls-panel {
            background: var(--cream-dark);
        }

        /* ==================== BODY TEXT ==================== */
       .body-text {
            font-family: 'Lora', serif;
            font-size: 1.2rem;
            line-height: 2;
            color: var(--text-dark);
            text-align: center;
            /* AGREGA ESTO: */
            white-space: pre-wrap; 
            padding: 20px;
        }

        .stanza {
            margin-bottom: 35px;
            white-space: pre-line;
            padding: 20px 0;
            position: relative;
        }

        .stanza:not(:last-child)::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 40px;
            height: 1px;
            background: var(--beige);
        }

        .coro {
            font-style: italic;
            font-weight: 500;
            background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(210, 170, 126, 0.15) 100%);
            padding: 30px 35px;
            border-left: 4px solid var(--gold);
            border-radius: 0 12px 12px 0;
            margin: 30px 0;
            white-space: pre-line;
            position: relative;
            box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
        }

        .coro::before {
            content: 'CORO';
            position: absolute;
            top: -12px;
            left: 25px;
            background: var(--gold);
            color: var(--primary-dark);
            padding: 4px 15px;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 700;
            font-style: normal;
            letter-spacing: 2px;
        }

        /* ==================== FOOTER CREDITS ==================== */
        .footer-credits {
            margin-top: 50px;
            padding-top: 30px;
            border-top: 2px solid var(--cream-dark);
            font-size: 0.9rem;
            color: var(--beige);
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 30px;
        }

        .credit-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .credit-item svg {
            color: var(--gold);
        }

        /* ==================== RESPONSIVE DESIGN ==================== */
        @media (max-width: 1024px) {
            :root {
                --sidebar-width: 300px;
            }

            #main-viewer {
                padding: 30px;
            }

            .content-card {
                padding: 50px;
            }
        }

        @media (max-width: 768px) {
            .menu-toggle {
                display: flex;
            }

            #sidebar {
                position: fixed;
                left: -100%;
                top: 0;
                height: 100%;
                width: 85%;
                max-width: 320px;
            }

            #sidebar.open {
                left: 0;
            }

            #main-viewer {
                padding: 20px;
                padding-top: 80px;
            }

            .content-card {
                padding: 40px 30px;
            }

            .versiculo-header h1 {
                font-size: 1.8rem;
            }

            .body-text {
                font-size: 1.1rem;
            }

            .coro {
                padding: 25px 20px;
                padding-top: 35px;
            }

            .footer-credits {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }

            .welcome-title {
                font-size: 1.6rem;
            }
        }

        @media (max-width: 480px) {
            #main-viewer {
                padding: 15px;
                padding-top: 80px;
            }

            .content-card {
                padding: 30px 20px;
                border-radius: 12px;
            }

            .versiculo-header h1 {
                font-size: 1.5rem;
            }

            .body-text {
                font-size: 1rem;
                line-height: 1.9;
            }

            .stanza {
                margin-bottom: 25px;
            }

            .coro {
                padding: 20px 15px;
                padding-top: 30px;
                margin: 20px 0;
            }

            .welcome-icon {
                width: 100px;
                height: 100px;
                font-size: 40px;
            }

            .welcome-title {
                font-size: 1.4rem;
            }

            .welcome-subtitle {
                font-size: 0.9rem;
            }

            .sidebar-header {
                padding: 25px 20px;
            }

            .sidebar-header h2 {
                font-size: 1.1rem;
            }

            .logo-icon {
                width: 50px;
                height: 50px;
                font-size: 24px;
            }
        }

        /* ==================== LOADING STATE ==================== */
        .loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px;
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 3px solid var(--cream-dark);
            border-top-color: var(--gold);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* ==================== EMPTY STATE ==================== */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--beige);
        }

        .empty-state svg {
            width: 60px;
            height: 60px;
            margin-bottom: 15px;
            opacity: 0.5;
        }

        /* ===================== Estilos de modal ====================  */
        /* Estilos adicionales para el Modal y Botones de Acción */
        .action-buttons-container {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #341D14; /* Tu color primary-dark */
            color: #D4AF37;    /* Tu color gold */
            border: 1px solid #D4AF37;
            padding: 10px 20px;
            border-radius: 30px;
            cursor: pointer;
            font-family: 'Montserrat', sans-serif;
            font-weight: 600;
            transition: all 0.3s ease;
            text-decoration: none;
        }

        .btn-action:hover {
            background: #D4AF37;
            color: #341D14;
        }

        /* Modal Styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(42, 22, 16, 0.9);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background: #FDF8F3;
            width: 95%;
            max-width: 900px;
            max-height: 90vh;
            border-radius: 12px;
            position: relative;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 50px rgba(0,0,0,0.5);
            border: 2px solid #D4AF37;
        }

        .modal-header {
            padding: 20px;
            border-bottom: 1px solid #D2AA7E;
            text-align: center;
        }

        .modal-body {
            overflow: auto;
            padding: 20px;
            text-align: center;
            background: white;
        }

        .modal-body img {
            max-width: 100%;
            height: auto;
        }

        .modal-footer-actions {
            padding: 20px;
            background: #F5EDE4;
            display: flex;
            justify-content: center;
            border-radius: 0 0 12px 12px;
        }

        .close-modal {
            position: absolute;
            right: 20px; top: 15px;
            font-size: 35px;
            color: #341D14;
            cursor: pointer;
            z-index: 10;
        }

        .btn-pdf {
            background: #c0392b;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 30px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        /* Fix para el texto plano */
        .body-text {
            white-space: pre-wrap !important;
            word-wrap: break-word;
        }