/* Estilos generales del contenedor */
.wp-tramites-container {
    font-family: Arial, sans-serif;
    padding: 20px;
}

/* Encabezado con botón de Crear */
.wp-tramites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.wp-tramites-header h2 {
    margin: 0;
    color: #333;
}

/* --- Filtros --- */
.wp-tramites-filters {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.wp-tramites-filters input[type="text"],
.wp-tramites-filters select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-grow: 1; 
    min-width: 150px;
}

.wp-tramites-filters button,
.action-button { 
    padding: 10px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wp-tramites-filters button:hover,
.action-button:hover {
    background-color: #005177;
}

.action-button.create-button {
    font-size: 1em;
}


/* --- Lista de Trámites (Diseño de Tarjeta) --- */
.wp-tramites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px;
}

.tramite-card {
    border: 1px solid #eee;
    border-left: 5px solid #0073aa; 
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    transition: box-shadow 0.3s;
}

.tramite-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tramite-card h3 {
    margin-top: 0;
    color: #333;
}

.tramite-card p {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
}

.tramite-card a.tramite-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #28a745; 
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- Botones de Acción (CRUD) --- */
.tramite-actions {
    margin-top: 15px;
    display: flex;
    gap: 5px;
}
.tramite-actions button {
    background: none;
    border: 1px solid #ccc;
    color: #333;
    padding: 5px 10px;
    font-size: 0.8em;
    cursor: pointer;
}
.tramite-actions button.action-delete:hover {
    color: red;
    border-color: red;
}
.tramite-actions button.action-edit:hover {
    color: #0073aa;
    border-color: #0073aa;
}


/* --- Paginación --- */
.wp-tramites-pagination {
    margin-top: 25px;
    text-align: center;
    padding: 10px;
    border-top: 1px solid #eee;
}

.wp-tramites-pagination span {
    font-weight: bold;
    margin-right: 10px;
}

.wp-tramites-pagination button {
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #0073aa;
    background-color: #f9f9f9;
    color: #0073aa;
    cursor: pointer;
    border-radius: 4px;
}

.wp-tramites-pagination button.is-active {
    background-color: #0073aa;
    color: white;
}


/* --- Modal Overlay (CRUD Form) --- */
.tramite-modal-overlay {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; 
    box-sizing: border-box;
    overflow-y: auto; 
}

.tramite-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    
    /* CORRECCIÓN UX: Permitir scroll en el contenido del modal */
    max-height: 95vh; 
    overflow-y: auto; 
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}
.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

.tramite-modal-content form label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.tramite-modal-content form input[type="text"],
.tramite-modal-content form input[type="url"],
.tramite-modal-content form textarea,
.tramite-modal-content form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.tramite-modal-content form button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    font-size: 1.1em;
}

/* --- Responsividad para Móviles --- */
@media (max-width: 600px) {
    .wp-tramites-filters {
        flex-direction: column;
    }

    .wp-tramites-filters input[type="text"],
    .wp-tramites-filters select,
    .wp-tramites-filters button,
    .wp-tramites-header {
        width: 100%;
    }
    
    .wp-tramites-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tramite-modal-content {
        padding: 15px;
    }
}