/* ========================================
   MODAL PDF - Vista previa de PDFs
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-pdf-container {
    width: 85%;
    height: 85%;
    max-width: 1200px;
    max-height: 85vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border-bottom: none;
}

.modal-header-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.modal-header-text {
    flex: 1;
    margin-left: 15px;
}

.modal-pdf-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-pdf-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.btn-modal-close-x {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-modal-close-x:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Barra de acciones */
.modal-pdf-actions-bar {
    display: flex;
    gap: 15px;
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.modal-pdf-actions-bar button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.modal-pdf-actions-bar button i {
    font-size: 16px;
}

.btn-descargar {
    background: #dc3545;
}

.btn-descargar:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-whatsapp {
    background: #25d366;
}

.btn-whatsapp:hover {
    background: #1faa52;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-email {
    background: #007bff;
}

.btn-email:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-imprimir {
    background: #6c757d;
}

.btn-imprimir:hover {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.modal-pdf-body {
    flex: 1;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.modal-pdf-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Ocultar texto de carga del iframe */
.modal-pdf-body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.modal-pdf-body.loaded::before {
    display: none;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-pdf-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-pdf-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .modal-pdf-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-modal-action span {
        display: none;
    }
}

/* Loading en iframe */
.modal-pdf-body::before {
    content: 'Cargando PDF...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #667eea;
    font-weight: 600;
    z-index: 1;
}

.modal-pdf-body iframe[src]~ ::before {
    display: none;
}