/**
 * Estilos Frontend del Portal de Notificaciones de Intimaciones
 */

.portal-intimaciones-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3338;
    margin: 20px 0;
    position: relative;
    box-sizing: border-box;
}

.portal-intimaciones-container * {
    box-sizing: border-box;
}

/* Cabecera */
.portal-header {
    margin-bottom: 24px;
}

.portal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 8px 0;
}

.portal-desc {
    font-size: 1rem;
    color: #646970;
    line-height: 1.5;
    margin: 0;
}

/* Alertas */
.portal-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.portal-alert-warning {
    background-color: #fcf9e8;
    border-left: 4px solid #dba617;
    color: #614700;
}

.portal-alert-info {
    background-color: #f0f6fc;
    border-left: 4px solid #2271b1;
    color: #135e96;
}

/* Barra de herramientas / Búsqueda */
.portal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    background: #ffffff;
    padding: 16px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portal-search-wrapper {
    position: relative;
    flex: 1 1 320px;
    max-width: 500px;
}

.portal-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #8c8f94;
    pointer-events: none;
}

.portal-search-input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    font-size: 0.95rem;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
    background: #fdfdfd;
}

.portal-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
    background: #ffffff;
}

.portal-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #a7aaad;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.portal-search-clear:hover {
    color: #d63638;
}

.portal-results-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: #50575e;
}

/* Tabla de Intimaciones */
.portal-table-responsive {
    overflow-x: auto;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.portal-table thead th {
    background-color: #f6f7f7;
    color: #1d2327;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid #c3c4c7;
    white-space: nowrap;
}

.portal-table thead th.portal-th-action {
    text-align: center;
}

.portal-table tbody tr {
    border-bottom: 1px solid #f0f0f1;
    transition: background-color 0.15s ease;
}

.portal-table tbody tr:hover {
    background-color: #f6f9fc;
}

.portal-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.portal-badge-dni {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e7f3ff;
    color: #0b4b84;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.88rem;
}

.portal-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #2271b1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.portal-btn-view:hover {
    background-color: #135e96;
    color: #ffffff;
    transform: translateY(-1px);
}

.portal-btn-view:active {
    transform: translateY(0);
}

.portal-td-action {
    text-align: center;
    white-space: nowrap;
}

/* Sin resultados */
.portal-no-results {
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    color: #646970;
    font-size: 1rem;
    margin-top: 10px;
}

/* Paginación */
.portal-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding: 10px 4px;
}

.portal-pagination-info {
    font-size: 0.9rem;
    color: #646970;
}

.portal-pagination-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.portal-page-btn {
    padding: 6px 12px;
    border: 1px solid #dcdcde;
    background-color: #ffffff;
    color: #2271b1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.portal-page-btn:hover:not(:disabled):not(.active) {
    background-color: #f0f0f1;
    border-color: #8c8f94;
}

.portal-page-btn.active {
    background-color: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.portal-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Modal Popup del Escrito */
.portal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(18, 22, 28, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.portal-modal-dialog {
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    animation: portalModalIn 0.25s ease-out;
}

@keyframes portalModalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.portal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e4e7;
    background: #f8f9fa;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.portal-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1d2327;
    margin: 0;
}

.portal-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #646970;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.portal-modal-close:hover {
    color: #d63638;
}

.portal-modal-body {
    padding: 28px 32px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.7;
    color: #2c3338;
    background: #ffffff;
}

.portal-modal-body h3 {
    margin-top: 0;
    color: #1d2327;
    text-align: center;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
    margin-bottom: 18px;
}

.portal-modal-body p {
    margin-bottom: 14px;
}

.portal-modal-body hr {
    border: 0;
    border-top: 1px dashed #c3c4c7;
    margin: 18px 0;
}

.portal-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e2e4e7;
    background: #f8f9fa;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.portal-btn-print {
    background-color: #007017;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.portal-btn-print:hover {
    background-color: #005a12;
}

.portal-btn-secondary {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #8c8f94;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.portal-btn-secondary:hover {
    background-color: #dcdcde;
}

/* Modo Responsive para Pantallas Pequeñas (Móviles) */
@media (max-width: 768px) {
    .portal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-search-wrapper {
        max-width: 100%;
    }

    .portal-table thead {
        display: none;
    }

    .portal-table, .portal-table tbody, .portal-table tr, .portal-table td {
        display: block;
        width: 100%;
    }

    .portal-table tr {
        margin-bottom: 14px;
        border: 1px solid #dcdcde;
        border-radius: 8px;
        padding: 8px 12px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }

    .portal-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f1;
        font-size: 0.9rem;
    }

    .portal-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }

    .portal-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #50575e;
        margin-right: 12px;
        text-align: left;
    }

    .portal-modal-dialog {
        max-height: 95vh;
    }

    .portal-modal-body {
        padding: 18px;
    }
}

/* Estilos de Impresión (@media print): Imprime formalmente la notificación */
@media print {
    body * {
        visibility: hidden !important;
    }

    #portalModal,
    #portalModal * {
        visibility: visible !important;
    }

    #portalModal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
        display: block !important;
    }

    .portal-modal-dialog {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
    }

    .portal-modal-header,
    .portal-modal-footer,
    .portal-modal-close {
        display: none !important;
    }

    .portal-modal-body {
        padding: 0 !important;
        font-size: 12pt !important;
        line-height: 1.6 !important;
        color: #000000 !important;
    }
}
