/* Helen Doron Location Map Plugin Styles */

.hdlm-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
}

/* Filters */
.hdlm-filters {
    background: rgba(255, 255, 255, 0.94);
    padding: 14px 0 18px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.hdlm-filter-search-wrap {
    position: relative;
    display: block;
}

.hdlm-filter-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: stretch;
    align-content: flex-start;
    justify-content: flex-start;
    height: auto;
}

.hdlm-filter-group {
    position: relative;
    min-width: 220px;
    flex: 1 1 220px;
}

.hdlm-filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.hdlm-filter-search,
.hdlm-filter-select {
    border-radius: 0;
    font-size: 15px;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hdlm-filter-search {
    width: 100%;
    min-height: 60px;
    padding: 14px 64px 14px 18px;
    border: 5px solid #18a8df;
    color: #2e3b49;
    box-sizing: border-box;
}

.hdlm-filter-search::placeholder {
    color: #5e6b78;
}

.hdlm-filter-search-icon {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #13233d;
    pointer-events: none;
}

.hdlm-filter-search-icon svg {
    width: 34px;
    height: 34px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.hdlm-filter-search:focus,
.hdlm-filter-select:focus {
    outline: none;
    border-color: #18a8df;
    box-shadow: 0 0 0 3px rgba(24, 168, 223, 0.12);
}

.hdlm-filter-select {
    min-width: 225px;
    height: 48px;
    padding: 0 42px 0 12px;
    border: 1px solid #243a5a;
    color: #0e2748;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #8f8f8f 50%),
        linear-gradient(135deg, #8f8f8f 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 20px,
        calc(100% - 10px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hdlm-btn {
    padding: 8px 16px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.hdlm-btn:hover {
    background-color: #005a87;
}

.hdlm-btn:active {
    background-color: #004471;
}

/* Content Wrapper */
.hdlm-content-wrapper {
    display: block;
    margin-bottom: 20px;
}

.hdlm-list-wrapper {
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.hdlm-list-wrapper h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
    font-size: 18px;
}

/* Map */
#hdlm-map {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* List Container */
.hdlm-list-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hdlm-list-container h3 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
    font-size: 16px;
}

/* Locations List */
.hdlm-locations-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    width: 100%;
    box-sizing: border-box;
}

.hdlm-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.hdlm-pagination-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.hdlm-pagination-btn {
    padding: 10px 18px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    background: #fff;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hdlm-pagination-btn:hover:not(:disabled) {
    background: #0073aa;
    color: #fff;
}

.hdlm-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hdlm-pagination-status {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.hdlm-location-item {
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.hdlm-item-category-badge {
    position: static;
    display: inline-flex;
    align-self: flex-start;
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    white-space: normal;
    z-index: 10;
    max-width: 100%;
}

.hdlm-location-item:hover {
    background-color: #fafbff;
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.hdlm-item-title {
    font-size: 18px;
    font-weight: 700;
    color: #081D39;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hdlm-item-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hdlm-item-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.hdlm-icon {
    width: 24px;
    height: 24px;
    color: #00AEEF;
    flex-shrink: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hdlm-item-contact-row a {
    color: #00AEEF;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
    transition: color 0.2s ease;
}

.hdlm-item-contact-row a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.hdlm-item-address-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.hdlm-directions-btn {
    display: inline-block;
    border: 2px solid #00AEEF;
    color: #00AEEF !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    background: transparent;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.hdlm-directions-btn:hover {
    background: #00AEEF;
    color: white !important;
    text-decoration: none !important;
}

/* InfoWindow Styles */
.hdlm-infowindow {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 320px;
    min-width: 260px;
    padding: 0 4px 4px;
    position: relative;
    box-sizing: border-box;
}

.hdlm-infowindow-close {
    position: absolute;
    top: -2px;
    right: 2px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}

.hdlm-infowindow-title {
    margin-top: 0;
    margin-bottom: 0;
    padding-right: 28px;
    font-size: 18px;
}

.hdlm-infowindow-body {
    margin-top: 12px;
}

.hdlm-infowindow-row {
    font-size: 13px;
    min-width: 0;
}

.hdlm-infowindow-badge {
    position: static;
    display: inline-flex;
    margin-top: 8px;
    margin-bottom: 4px;
}

.hdlm-infowindow .hdlm-item-contact-row a,
.hdlm-infowindow .hdlm-item-address-row span {
    font-size: 13px;
    line-height: 1.45;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hdlm-infowindow .hdlm-item-address-row {
    color: #5f6b76;
}

.hdlm-infowindow-btn {
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    align-self: stretch;
}

.gm-style .gm-style-iw-c button[aria-label="Close"] {
    display: none !important;
}

.gm-style .gm-style-iw-ch,
.gm-style .gm-style-iw-chr {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gm-style .gm-style-iw-c {
        max-width: calc(100vw - 24px) !important;
    }

    .gm-style .gm-style-iw-d {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .hdlm-infowindow {
        width: calc(100vw - 48px);
        max-width: calc(100vw - 48px);
        min-width: 0;
    }

    .hdlm-directions-btn.hdlm-infowindow-btn {
        width: 78%;
        margin-left: auto;
        margin-right: auto;
        align-self: center;
    }

    .hdlm-container {
        display: flex;
        flex-direction: column;
        width: auto;
        max-width: none;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    #hdlm-map {
        order: 1;
        width: 100%;
        border-radius: 0;
        margin-bottom: 16px;
    }

    .hdlm-list-wrapper {
        order: 2;
        margin-top: 0;
        display: flex;
        flex-direction: column;
    }

    .hdlm-filters {
        order: 1;
    }

    .hdlm-list-wrapper h3 {
        order: 2;
        margin-top: 0;
    }

    #hdlm-locations-list {
        order: 3;
    }

    #hdlm-pagination {
        order: 4;
    }

    .hdlm-locations-list {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .hdlm-pagination-inner {
        width: 100%;
    }

    .hdlm-filters {
        padding: 12px 0 16px;
        gap: 12px;
    }

    .hdlm-filter-row {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .hdlm-filter-group {
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
    }

    .hdlm-filter-search,
    .hdlm-filter-select {
        width: 100%;
        min-width: 0;
    }

    .hdlm-filter-search {
        min-height: 54px;
        padding: 12px 56px 12px 16px;
        border-width: 3px;
    }

    #hdlm-map {
        height: 320px !important;
        min-height: 320px;
    }

    .hdlm-location-item {
        padding: 20px 16px;
        gap: 14px;
    }

    .hdlm-item-title {
        font-size: 17px;
    }

    .hdlm-infowindow-title {
        font-size: 16px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hdlm-directions-btn {
        width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    .hdlm-container {
        margin-left: -12px;
        margin-right: -12px;
        padding: 0;
    }

    .hdlm-filters {
        gap: 10px;
    }

    .hdlm-filter-search {
        min-height: 50px;
        padding-right: 56px;
    }

    .hdlm-filter-select {
        height: 46px;
        padding-right: 38px;
        background-position:
            calc(100% - 14px) 19px,
            calc(100% - 8px) 19px;
    }

    .hdlm-filter-search-icon {
        right: 14px;
    }

    .hdlm-filter-search-icon svg {
        width: 30px;
        height: 30px;
    }

    .hdlm-location-item {
        padding: 18px 14px;
    }

    #hdlm-map {
        height: 260px !important;
        min-height: 260px;
    }
}

/* Scrollbar Styling */
.hdlm-list-container::-webkit-scrollbar {
    width: 8px;
}

.hdlm-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hdlm-list-container::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 10px;
}

.hdlm-list-container::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Utilities */
.hdlm-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.hdlm-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.hdlm-success {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}
