﻿/* ── Directory Search: page header row ── */

.dir-results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* ── Directory Search: search-criteria summary box ── */

.search-criteria-box {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background-color: #f0f4f8;
    border-left: 4px solid #2c3e50;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    border-radius: 0 4px 4px 0;
}

.search-criteria-box__criteria {
    color: #444;
}

.search-criteria-box__count {
    white-space: nowrap;
    font-size: 15px;
    color: #2c3e50;
}

.search-criteria-box__count strong {
    font-size: 18px;
}

/* ── Directory Search: live filter bar ── */

.dir-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f4f8;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.dir-filter-input-wrap {
    position: relative;
    flex: 1;
    max-width: 460px;
}

.dir-filter-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #888;
    pointer-events: none;
}

.dir-filter-input {
    width: 100%;
    padding: 8px 32px 8px 34px;
    font-size: 14px;
    color: #222;
    background: #fff;
    border: 1px solid #b0bec5;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.dir-filter-input::placeholder {
    color: #aaa;
}

.dir-filter-input:focus {
    border-color: #17457a;
    box-shadow: 0 0 0 3px rgba(23, 69, 122, 0.12);
}

.dir-filter-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%23aaa'/%3E%3Cline x1='5' y1='5' x2='11' y2='11' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3Cline x1='11' y1='5' x2='5' y2='11' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    cursor: pointer;
    opacity: 0.7;
    margin-right: 2px;
}

.dir-filter-input::-webkit-search-cancel-button:hover {
    opacity: 1;
}

.dir-filter-count {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background-color: #17457a;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    min-width: 0;
    transition: opacity 0.15s;
}

.dir-filter-count:empty {
    display: none;
}

/* ── Directory Search: result cards ── */

.dir-result-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 5px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    overflow: hidden;
}

.dir-result-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #17457a;
    padding: 10px 16px;
}

.dir-result-card__number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background-color: #cd163f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.dir-result-card__name {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.dir-result-card__body {
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dir-result-card__field {
    display: flex;
    gap: 0;
    font-size: 14px;
    line-height: 1.5;
}

.dir-result-card__label {
    flex-shrink: 0;
    width: 110px;
    font-weight: 600;
    color: #666;
}

.dir-result-card__value {
    color: #222;
    flex: 1;
}

.dir-result-card__certs {
    color: #1a5276;
    font-weight: 500;
}

/* narrow screens: stack label above value */
@media (max-width: 480px) {
    .dir-result-card__field {
        flex-direction: column;
        gap: 1px;
    }

    .dir-result-card__label {
        width: auto;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #888;
    }
}

/* ── Directory Search: pager ── */

.dir-pager {
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dir-pager--bottom {
    margin-top: 24px;
}

.dir-pager-link {
    display: inline-block;
    min-width: 34px;
    padding: 5px 10px;
    text-align: center;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    color: #17457a;
    text-decoration: none;
    font-size: 13px;
    background: #fff;
    line-height: 1.4;
}

.dir-pager-link:hover {
    background-color: #ddeaf5;
    border-color: #17457a;
    color: #17457a;
    text-decoration: none;
}

.dir-pager-link--active {
    background-color: #17457a;
    color: #fff !important;
    border-color: #17457a;
    font-weight: bold;
    cursor: default;
    pointer-events: none;
}

/* ── Directory Search: search page layout ── */

.dir-search-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e8edf2;
}

.dir-search-section:last-of-type {
    border-bottom: none;
}

.dir-search-section__label {
    flex-shrink: 0;
    width: 130px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}

.dir-search-step {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background-color: #cd163f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.dir-search-section__body {
    flex: 1;
}

/* ── Certification checkbox grid ── */

.dir-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.dir-cert-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #dde3ea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: normal;
    color: #333;
    background: #fff;
    transition: border-color 0.12s, background 0.12s;
    margin: 0;
    line-height: 1.4;
}

.dir-cert-item:hover {
    border-color: #148a8a;
    background-color: #f0fafa;
}

.dir-cert-item--checked {
    border-color: #148a8a;
    background-color: #eaf5f5;
    color: #0b5252;
}

.dir-cert-item input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #148a8a;
}

/* ── Location section ── */

.dir-search-section__body--location {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex-wrap: wrap;
}

.dir-location-col {
    flex: 1;
    min-width: 180px;
}

.dir-location-or {
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    padding-top: 34px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.dir-location-label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.dir-location-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.dir-select {
    width: 100%;
    max-width: 300px;
}

/* ── Action buttons ── */

.dir-search-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Narrow screen adjustments ── */

@media (max-width: 600px) {
    .dir-search-section {
        flex-direction: column;
        gap: 12px;
    }

    .dir-search-section__label {
        width: auto;
    }

    .dir-location-or {
        width: 100%;
        padding: 6px 0;
        text-align: left;
    }

    .dir-select {
        max-width: 100%;
    }
}
