/* Estilos para el plugin PP PDFs */

/* ===== GESTIÓN DE PDFs (pp_pdfs) ===== */
.pp-pdfs-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pp-pdfs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pp-pdfs-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.pp-pdfs-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pp-pdfs-search {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.pp-pdfs-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pp-pdfs-btn-primary {
    background-color: #0073aa;
    color: white;
}

.pp-pdfs-btn-primary:hover {
    background-color: #005a87;
}

.pp-pdfs-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.pp-pdfs-btn-secondary:hover {
    background-color: #e0e0e0;
}

.pp-pdfs-table-container {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pp-pdfs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.pp-pdfs-table thead {
    background-color: #f5f5f5;
}

.pp-pdfs-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    position: relative;
}

.pp-pdfs-sort-icon {
    font-size: 10px;
    margin-left: 5px;
    color: #999;
}

.pp-pdfs-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.pp-pdfs-table tbody tr:hover {
    background-color: #f9f9f9;
}

.pp-pdfs-col-position {
    width: 100px;
}

.pp-pdfs-position-column {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-pdfs-drag-handle {
    cursor: move;
    color: #999;
    font-size: 18px;
    transition: color 0.2s;
}

.pp-pdfs-drag-handle:hover {
    color: #2271b1;
}

.pp-pdfs-order-number {
    font-weight: 600;
    color: #666;
    min-width: 25px;
    font-size: 13px;
}

.pp-pdfs-table tbody tr.pp-pdfs-dragging {
    opacity: 0.5;
}

.pp-pdfs-table tbody tr.pp-pdfs-sortable-placeholder {
    background: #f0f0f0;
    height: 40px;
    border: 2px dashed #ddd;
}

.pp-pdfs-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pp-pdfs-status-dot.visible {
    background-color: #46b450;
}

.pp-pdfs-status-dot.hidden {
    background-color: #dc3232;
}

.pp-pdfs-titulo-content strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.pp-pdfs-descripcion {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.pp-pdfs-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: transform 0.2s;
}

.pp-pdfs-btn-icon:hover {
    transform: scale(1.2);
}

.pp-pdfs-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Modal - Estilo similar a PluginGuia */
.pp-pdfs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.pp-pdfs-modal.active {
    display: flex;
}

.pp-pdfs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    pointer-events: auto;
}

.pp-pdfs-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    isolation: isolate;
}

.pp-pdfs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    z-index: 1;
}

.pp-pdfs-modal-header h2,
.pp-pdfs-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.pp-pdfs-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.pp-pdfs-modal-close:hover {
    color: #000;
}

#pp-pdfs-form {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.pp-pdfs-form-group {
    margin-bottom: 20px;
}

.pp-pdfs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.pp-pdfs-form-group input[type="text"],
.pp-pdfs-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.pp-pdfs-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Input file directo */
.pp-pdfs-form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.pp-pdfs-form-group input[type="file"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Barra de progreso de carga de archivo */
.pp-pdfs-file-upload-progress {
    margin-top: 10px;
}

.pp-pdfs-progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.pp-pdfs-progress-fill {
    height: 100%;
    background: #2271b1;
    width: 0%;
    transition: width 0.3s ease;
}

.pp-pdfs-progress-text {
    font-size: 12px;
    color: #666;
    display: block;
}

.pp-pdfs-form-group .description {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Estilos para el campo de estado visible en el modal */
.pp-pdfs-visible-status-group {
    margin-top: 20px;
}

.pp-pdfs-visible-status-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.pp-pdfs-status-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-pdfs-status-option {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.pp-pdfs-status-option input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pp-pdfs-status-dot-option {
    margin-right: 8px;
    flex-shrink: 0;
}

.pp-pdfs-status-option:hover {
    background: #f9f9f9;
    border-color: #2271b1;
}

.pp-pdfs-status-option input[type="radio"]:checked + .pp-pdfs-status-dot-option {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

.pp-pdfs-status-option input[type="radio"]:checked ~ .pp-pdfs-status-text {
    font-weight: 600;
    color: #2271b1;
}

.pp-pdfs-status-dot-option {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pp-pdfs-status-dot-option.pp-pdfs-status-active {
    background-color: #46b450;
    box-shadow: 0 0 0 2px rgba(70, 180, 80, 0.2);
}

.pp-pdfs-status-dot-option.pp-pdfs-status-inactive {
    background-color: #999;
    box-shadow: 0 0 0 2px rgba(153, 153, 153, 0.2);
}

.pp-pdfs-status-text {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.pp-pdfs-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.pp-pdfs-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    min-width: 120px;
    text-align: center;
}

.pp-pdfs-btn-primary {
    background: #2271b1;
    color: #fff;
}

.pp-pdfs-btn-primary:hover:not(:disabled) {
    background: #135e96;
}

.pp-pdfs-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.pp-pdfs-btn-cancel:hover {
    background: #e0e0e0;
}

.pp-pdfs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== VISOR DE PDFs (pp_visor) ===== */
.pp-visor-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 100px);
    min-height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.pp-visor-sidebar {
    width: 15%;
    background-color: #f5f5f5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.pp-visor-thumbnails {
    padding: 10px;
}

.pp-visor-thumbnail-item {
    margin-bottom: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 8px;
    transition: all 0.3s ease;
    background: white;
}

.pp-visor-thumbnail-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pp-visor-thumbnail-item.active {
    border-color: #0073aa;
    background-color: #e6f3ff;
}

.pp-visor-thumbnail-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.pp-visor-thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pp-visor-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    color: #666;
    font-size: 12px;
    font-weight: bold;
}

.pp-visor-thumbnail-title {
    font-size: 11px;
    color: #333;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
}

.pp-visor-main {
    width: 85%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pp-visor-pdf-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #525252;
}

.pp-visor-pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pp-visor-empty,
.pp-visor-empty-main {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .pp-pdfs-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pp-pdfs-header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .pp-pdfs-search {
        width: 100%;
    }
    
    .pp-visor-container {
        flex-direction: column;
        height: auto;
    }
    
    .pp-visor-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .pp-visor-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 10px;
    }
    
    .pp-visor-thumbnail-item {
        min-width: 120px;
        margin-bottom: 0;
    }
    
    .pp-visor-main {
        width: 100%;
        height: 600px;
    }
}

