/**
 * Estilos CSS para el plugin Personas Desaparecidas.
 *
 * @package Personas_Desaparecidas
 * @since   1.0.0
 */

/* ==========================================================================
   Estilos generales del admin
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Encode+Sans+Condensed:wght@300;400;500;600;700&display=swap');


p,
button,
input,
textarea,
select,
span {
    font-family: 'Encode Sans Condensed', sans-serif !important;
}

.pd-upload-page .form-table td,
.pd-gallery-page .form-table td {
    vertical-align: top;
}

.pd-upload-result,
.pd-gallery-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.pd-upload-result.pd-success,
.pd-gallery-result.pd-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.pd-upload-result.pd-error,
.pd-gallery-result.pd-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.pd-upload-result ul,
.pd-gallery-result ul {
    margin: 10px 0 0 20px;
    list-style: disc;
}

/* ==========================================================================
   Vista previa de imágenes (carga)
   ========================================================================== */

.pd-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.pd-preview-grid .pd-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.pd-preview-grid .pd-preview-item:hover {
    border-color: #dc3545;
}

.pd-preview-grid .pd-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-preview-grid .pd-preview-item .pd-preview-size {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
}

.pd-preview-grid .pd-preview-item .pd-preview-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 0;
    z-index: 2;
}

.pd-preview-grid .pd-preview-item:hover .pd-preview-remove {
    opacity: 1;
}

.pd-preview-grid .pd-preview-item .pd-preview-remove:hover {
    background: rgb(220, 53, 69);
    transform: scale(1.15);
}

/* ==========================================================================
   Filtro de galería
   ========================================================================== */

.pd-gallery-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: #f1f1f1;
    border-radius: 4px;
}

.pd-gallery-filter label {
    font-weight: 600;
}

.pd-gallery-filter .pd-date-input {
    width: auto;
}

.pd-gallery-filter .pd-image-count {
    margin-left: auto;
    font-style: italic;
    color: #666;
}

/* ==========================================================================
   Acciones masivas
   ========================================================================== */

.pd-bulk-actions {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* ==========================================================================
   Tabla administrativa
   ========================================================================== */

.pd-images-table .pd-thumbnail img {
    display: block;
    border-radius: 3px;
}

.pd-images-table .pd-filename {
    max-width: 300px;
    word-break: break-all;
}

/* ==========================================================================
   Estilos públicos (shortcode)
   ========================================================================== */

.pd-public-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.pd-public-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.pd-public-title {
    color: #000000;
    font-size: 20px;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.pd-public-header label {
    font-weight: 600;
    font-size: 16px;
}

/* ==========================================================================
   Datepicker personalizado (dropdown)
   ========================================================================== */

.pd-datepicker-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.pd-datepicker-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    min-width: 220px;
    justify-content: space-between;
}

/* Los hijos visuales del trigger no deben interceptar clics, 
   el input overlay es quien recibe todos los clics. */
.pd-datepicker-trigger > .pd-datepicker-icon,
.pd-datepicker-trigger > .pd-datepicker-text,
.pd-datepicker-trigger > .pd-datepicker-selected,
.pd-datepicker-trigger > .pd-datepicker-arrow {
    pointer-events: none;
}

.pd-datepicker-trigger:hover {
    border-color: #00b140;
    box-shadow: 0 0 0 3px rgba(0, 177, 64, 0.15);
}

.pd-datepicker-trigger.pd-active,
.pd-datepicker-trigger.pd-open {
    border-color: #00b140;
    box-shadow: 0 0 0 3px rgba(0, 177, 64, 0.15);
}

.pd-datepicker-trigger.pd-open .pd-datepicker-arrow svg {
    transform: rotate(180deg);
}

.pd-datepicker-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pd-datepicker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.pd-datepicker-trigger:hover .pd-datepicker-icon,
.pd-datepicker-trigger.pd-active .pd-datepicker-icon,
.pd-datepicker-trigger.pd-open .pd-datepicker-icon {
    color: #00b140;
}

.pd-datepicker-icon svg {
    display: block;
}

.pd-datepicker-text {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    line-height: 1;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.pd-datepicker-trigger.pd-active .pd-datepicker-text {
    display: none;
}

.pd-datepicker-selected {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.pd-datepicker-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.pd-datepicker-trigger:hover .pd-datepicker-arrow,
.pd-datepicker-trigger.pd-active .pd-datepicker-arrow,
.pd-datepicker-trigger.pd-open .pd-datepicker-arrow {
    color: #00b140;
}

.pd-datepicker-arrow svg {
    display: block;
    transition: transform 0.2s ease;
}

/* Dropdown list */
.pd-datepicker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.pd-datepicker-dropdown::-webkit-scrollbar {
    width: 6px;
}

.pd-datepicker-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 0 8px 8px;
}

.pd-datepicker-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.pd-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.pd-dropdown-item:last-child {
    border-bottom: none;
}

.pd-dropdown-item:hover {
    background: #f0f9f2;
    color: #00b140;
}

.pd-dropdown-item:hover .pd-dropdown-icon {
    color: #00b140;
}

.pd-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.pd-dropdown-icon svg {
    display: block;
}

.pd-dropdown-text {
    font-size: 14px;
    color: #333;
    font-weight: 400;
    line-height: 1.3;
}

.pd-dropdown-item:hover .pd-dropdown-text {
    color: #00b140;
}

.pd-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Display visible del datepicker: muestra la fecha formateada en español.
   Sus hijos NO interceptan clics; el input overlay los recibe todos. */
.pd-datepicker-display {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    min-width: 230px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.pd-datepicker-display:hover {
    border-color: #00b140;
    box-shadow: 0 0 0 3px rgba(0, 177, 64, 0.15);
}

/* Los hijos del display no deben interceptar clics. */
.pd-datepicker-display > * {
    pointer-events: none;
}

.pd-datepicker-display-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

/* Icono del calendario más grande */
.pd-datepicker-display .pd-datepicker-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Input date invisible sobrepuesto: captura clics y abre el calendario.
   El picker indicator se expande para cubrir todo el input. */
.pd-date-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 16px;
    z-index: 10;
}

/* Expande el icono del calendario para cubrir toda el área. */
.pd-date-input-overlay::-webkit-calendar-picker-indicator {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    opacity: 1 !important;
    display: block !important;
}

/* ==========================================================================
   Grid de tarjetas
   ========================================================================== */

.pd-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    transition: opacity 0.3s ease;
}

.pd-grid-item {
    break-inside: avoid;
    padding: 4px !important;
}

.pd-card {
    background: #fff;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    transition: box-shadow 0.3s ease, transform 0.2s ease !important;
    text-align: center !important;
}

.pd-card:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18) !important;
    transform: translateY(-2px) !important;
}

.pd-card-image {
    width: 100%;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.pd-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-card-footer {
    padding: 12px 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-btn-more {
    display: inline-block;
    padding: 8px 16px;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
    background: #003c71!important;
    border-width: 0.0625rem;
    border-style: solid;
    border-color: #003c71!important;
    font-weight: 600;
    width: auto;
}

.pd-btn-more:hover {
    background: #ffffff !important;
    color: #003c71 !important;
}

/* ==========================================================================
   Modal fullscreen
   ========================================================================== */

/* Evita el scroll del body cuando el modal está activo.
   Funciona dentro de iframe sin perder la posición. */
body.pd-no-scroll {
    overflow: hidden !important;
    height: auto !important;
    position: static !important;
    top: auto !important;
    width: auto !important;
}

.pd-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.pd-modal.pd-active {
    display: flex;
}

.pd-modal.pd-iframe-mode {
    position: absolute;
    top: 0;
    left: 0;
}

.pd-modal-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.pd-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    max-height: 90dvh;
    z-index: 2;
    animation: pdFadeIn 0.3s ease;
    /* height: 100%; */
}

.pd-modal-close {
    position: absolute;
    top: -55px;
    right: 0;
    background: #003c71 !important;
    border: none;
    color: #ffffff !important;
    font-size: 30px !important;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    border: 1px solid #00b140 !important;
 
}

.pd-modal-close span{
    position: relative;
    top: -3px;
 
}

.pd-modal-close:hover {
    opacity: 1;
    background: #0d8037 !important;
    color: #ffffff !important;
}

.pd-modal-body {
    text-align: center;
    overflow-y: auto;
}

.pd-modal-body img {
    max-width: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.pd-modal-name {
    margin-top: 15px;
    color: #fff;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   Spinner de carga
   ========================================================================== */

.pd-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.pd-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: pdSpin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes pdSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pdFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   No images text
   ========================================================================== */

.pd-no-images {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #888;
    font-size: 16px;
}

/* ==========================================================================
   Barra de progreso (carga por lotes)
   ========================================================================== */

.pd-progress-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pd-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.pd-progress-percent {
    font-weight: 700;
    color: #00b140;
}

.pd-progress-bar-outer {
    width: 100%;
    height: 18px;
    background: #e9ecef;
    border-radius: 9px;
    overflow: hidden;
}

.pd-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #00b140, #00d455);
    border-radius: 9px;
    transition: width 0.4s ease;
    min-width: 0;
}

.pd-progress-detail {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ==========================================================================
   Resumen final de carga
   ========================================================================== */

.pd-upload-summary {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 2px solid #00b140;
    border-radius: 8px;
}

.pd-upload-summary h3 {
    margin-top: 0;
    color: #00b140;
}

.pd-upload-summary table {
    width: 100%;
    border-collapse: collapse;
}

.pd-upload-summary table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.pd-upload-summary table td strong {
    color: #333;
}

/* ==========================================================================
   Paginación
   ========================================================================== */

.pd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0 10px;
    padding: 15px;
    transition: opacity 0.3s ease;
}

.pd-page-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: #003c71;
    color: #000000 !important;
    border: 1px solid #003c71 !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
}

.pd-page-btn:hover {

    background: #003c71!important;
    color: #ffffff !important
 
}

.pd-page-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #ffffff !important;
}

.pd-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pd-page-info {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    padding: 0 5px;
}

/* ==========================================================================
   Responsive: Ajustes para tablet y móviles
   ========================================================================== */

/* Tablet: 3 cards por fila */
@media (max-width: 1024px) {
    .pd-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .pd-card-image {
        height: 200px;
    }

    .pd-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pd-public-wrapper {
        padding: 0 20px;
    }
}

/* Móvil mediano: 2 cards por fila */
@media (max-width: 768px) {
    .pd-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .pd-card-image {
        height: 160px;
    }

    .pd-card-footer {
        padding: 8px;
    }

    .pd-btn-more {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pd-public-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pd-public-header label {
        margin-bottom: 5px;
    }

    .pd-public-title {
        font-size: 18px;
    }

    .pd-datepicker-trigger {
        width: 100%;
        min-width: 0;
    }

    .pd-datepicker-dropdown {
        left: 0;
        right: 0;
        min-width: 0;
        width: 100%;
    }

    .pd-datepicker-display {
        width: 100%;
        min-width: 0;
    }

    .pd-modal {
        padding: 20px !important;
    }

    .pd-modal-content {
        max-width: 95% !important;
        max-height: 85% !important;
    }

    .pd-modal-body {
        overflow-y: auto !important;
    }

    .pd-modal-body img {
        max-width: 100% !important;
        max-height: 70vh !important;
    }

    .pd-modal-close {
        top: -35px !important;
        right: 5px !important;
        font-size: 28px !important;
    }

    .pd-gallery-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .pd-gallery-filter .pd-image-count {
        margin-left: 0;
        text-align: center;
    }

    .pd-bulk-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .pd-page-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}

/* Móvil pequeño: 1 card por fila */
@media (max-width: 480px) {
    .pd-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .pd-modal {
        padding: 10px !important;
    }

    .pd-modal-content {
        max-width: 100% !important;
        max-height: 90% !important;
    }

    .pd-modal-body img {
        max-height: 60vh !important;
    }

    .pd-modal-close {
        top: -32px !important;
        right: 0 !important;
        font-size: 26px !important;
    }

    .pd-card-image {
        height: auto;
        max-height: 300px;
    }

    .pd-card-image img {
        object-fit: contain;
    }

    .pd-public-wrapper {
        padding: 0 10px;
    }

    .pd-public-title {
        font-size: 16px;
        text-align: center;
    }

    .pd-public-header {
        padding: 10px;
    }

    .pd-datepicker-display-text {
        font-size: 13px;
    }

    .pd-pagination {
        flex-direction: column;
        gap: 8px;
    }

    .pd-page-btn {
        width: 100%;
        justify-content: center;
    }

    .pd-page-info {
        font-size: 13px;
    }
}




.pd-modal-name{
    opacity: 0 !important;
}