/* Employment Agencies list: uses the GLMIS green palette ($green #22af47, primary #0d8e45, dark #056b33). */

:root {
    --ea-primary: #0d8e45;
    --ea-primary-dark: #056b33;
    --ea-primary-light: #eff9f2;
    --ea-accent: #22af47;
    --ea-text: #1f2d3d;
    --ea-muted: #6b7785;
    --ea-border: #e3e8ee;
    --ea-radius: 14px;
}

.ea-page {
    background: #f6f9f7;
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.loading-overlay.show { display: flex; }

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--ea-primary);
    border-radius: 50%;
    animation: ea-spin 1s linear infinite;
}
@keyframes ea-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header: plain, no colour band */
.ea-header {
    padding-top: 6.5rem;
    padding-bottom: 1.5rem;
}
.ea-header h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--ea-text);
    margin-bottom: 0.4rem;
}
.ea-hero-sub {
    color: var(--ea-muted);
    margin: 0;
    max-width: 640px;
}

/* Filters */
.ea-filters {
    position: relative;
    z-index: 10;
    background: #fff;
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    padding: 1.1rem;
}
.ea-search-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.ea-search-input {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid var(--ea-border);
    padding: 0.6rem 0.9rem;
}
.ea-search-input:focus,
.ea-select:focus {
    border-color: #9aa5b1;
    box-shadow: 0 0 0 0.2rem rgba(107, 119, 133, 0.15);
    outline: none;
}
.ea-btn-primary {
    background: var(--ea-primary);
    border: 1px solid var(--ea-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    transition: background 0.2s ease;
}
.ea-btn-primary:hover {
    background: var(--ea-primary-dark);
    border-color: var(--ea-primary-dark);
    color: #fff;
}
.ea-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}
.ea-select-wrap {
    position: relative;
}
.ea-select-wrap > i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ea-muted);
    pointer-events: none;
    z-index: 2;
}
.ea-select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--ea-border);
    padding: 0.6rem 2.2rem 0.6rem 2.3rem;
    font-size: 0.95rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7785' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Results grid */
.ea-results-meta {
    color: var(--ea-muted);
    font-size: 0.9rem;
    margin: 1.25rem 0 0.75rem;
}
.ea-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 768px) {
    .ea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .ea-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Card */
.ea-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    padding: 1.1rem 1.15rem 1rem;
    transition: box-shadow 0.2s ease;
}
.ea-card:hover {
    box-shadow: 0 8px 20px rgba(31, 45, 61, 0.08);
}
.ea-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}
.ea-badge-private,
.ea-badge-gov {
    background: #f1f3f5;
    color: var(--ea-muted);
}
.ea-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ea-text);
    margin: 0 0 0.6rem;
    word-break: break-word;
}
.ea-card-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--ea-muted);
    flex: 1;
}
.ea-card-meta li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
    word-break: break-word;
}
.ea-card-meta i {
    color: var(--ea-muted);
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.ea-card-meta a {
    color: var(--ea-text);
    text-decoration: none;
}
.ea-card-meta a:hover { text-decoration: underline; }

.ea-gps-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #c5ccd4;
    text-underline-offset: 3px;
}

.ea-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ea-border);
}
.ea-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--ea-primary);
    color: #fff;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.ea-info-btn:hover {
    background: var(--ea-primary-dark);
    color: #fff;
}

/* Empty state */
.ea-empty {
    background: #fff;
    border: 1px dashed #b7d9c4;
    border-radius: var(--ea-radius);
    padding: 2.5rem 1rem;
    text-align: center;
    margin-top: 1rem;
}
.ea-empty i {
    font-size: 3rem;
    color: var(--ea-primary);
}
.ea-empty h4 {
    color: var(--ea-text);
    font-weight: 700;
    margin: 0.75rem 0 0.4rem;
}
.ea-empty p {
    color: var(--ea-muted);
}

/* Pagination */
.ea-pagination .pagination {
    justify-content: center;
    flex-wrap: wrap;
}
.ea-pagination .page-link {
    color: var(--ea-text);
    border-radius: 8px;
    margin: 0 2px;
}
.ea-pagination .page-item.active .page-link {
    background: var(--ea-text);
    border-color: var(--ea-text);
    color: #fff;
}

/* Phone */
@media (max-width: 576px) {
    .ea-header { padding-top: 5.5rem; }
    .ea-filter-row { grid-template-columns: 1fr; }
    .ea-search-row { flex-direction: column; }
    .ea-btn-primary { width: 100%; }
    .ea-select { font-size: 16px; min-height: 44px; }
}

/* Details modal */
#peaDetails .modal-content {
    border-radius: var(--ea-radius);
    border: none;
}
#peaDetails .modal-header {
    border-bottom: 1px solid var(--ea-border);
}
#peaDetails .license-gps-link {
    color: var(--ea-primary-dark);
    font-weight: 600;
    text-decoration: none;
}
#peaDetails .license-gps-link:hover { text-decoration: underline; }
