/*--------------------------------------------------------------
# Estilos del Portal de Certificados
--------------------------------------------------------------*/

/* Contenedor principal y layout con Flexbox */
.pcc-portal-wrapper {
    display: flex;
    flex-wrap: wrap; /* Permite que los elementos se apilen en pantallas pequeñas */
    gap: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    margin: 2em 0;
}

/* Barra lateral de filtros */
.pcc-filters {
    flex: 1;
    min-width: 250px; /* Ancho mínimo para la barra de filtros */
    background: #fdfdfd;
    padding: 1.5rem;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    height: fit-content;
}

.pcc-filters h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25em;
    color: #222;
}

.pcc-filters p {
    margin-bottom: 1rem;
}

.pcc-filters label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9em;
}

.pcc-filters input[type="text"],
.pcc-filters select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Importante para el padding */
}

.pcc-filters .button {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: #28a745; /* Verde corporativo */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.pcc-filters .button:hover {
    background-color: #218838; /* Verde más oscuro al pasar el ratón */
}

/* Contenedor de resultados */
.pcc-results {
    flex: 3;
    min-width: 300px; /* Ancho mínimo para los resultados */
}

.pcc-results h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.pcc-results > p {
    color: #777;
    margin-top: 0;
    font-style: italic;
}

/* Estilos de la tabla */
.pcc-table-container {
    overflow-x: auto; /* Permite scroll horizontal en pantallas muy pequeñas */
}
.pcc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.95em;
}
.pcc-table th, 
.pcc-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}
.pcc-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    color: #555;
}

.pcc-table tr:hover {
    background-color: #f5f5f5;
}

.pcc-table .button {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap; /* Evita que el texto del botón se rompa */
}
.pcc-table .button:hover {
    background-color: #218838;
}

/* Paginación */
.pcc-pagination {
    margin-top: 2rem;
    text-align: center;
}
.pcc-pagination .page-numbers {
    padding: 8px 14px;
    margin: 0 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #28a745;
    border-radius: 4px;
}
.pcc-pagination .page-numbers:hover {
    background-color: #f0f0f0;
}
.pcc-pagination .page-numbers.current {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}

/*--------------------------------------------------------------
# Responsividad
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
    .pcc-portal-wrapper {
        flex-direction: column;
    }
    .pcc-table {
        display: block; /* Rompemos el layout de tabla */
    }
    .pcc-table thead {
        display: none; /* Ocultamos los encabezados */
    }
    .pcc-table tbody, .pcc-table tr, .pcc-table td {
        display: block;
        width: 100%;
    }
    .pcc-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    .pcc-table td {
        text-align: right; /* Alineamos el contenido a la derecha */
        position: relative;
        padding-left: 50%; /* Dejamos espacio para la etiqueta */
        border-bottom: 1px solid #eee;
    }
    .pcc-table td::before {
        content: attr(data-label); /* Usamos el data-label como pseudo-elemento */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}