/* ATTR Clinic Locator - Updated Frontend Styles */

* {
    box-sizing: border-box;
}
.attr-direction-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.attr-direction-popup {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}
.attr-direction-popup h3 {
    margin: 0 0 20px 0;
    color: #8B0000;
    font-size: 20px;
}
.attr-direction-popup-field {
    margin-bottom: 15px;
}
.attr-direction-popup-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}
.attr-direction-popup-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.attr-direction-popup-field input:focus {
    outline: none;
    border-color: #8B0000;
}
.attr-direction-popup-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.attr-direction-popup-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.attr-direction-popup-btn-submit {
    background: #8B0000;
    color: white;
}
.attr-direction-popup-btn-submit:hover {
    background: #6B0000;
}
.attr-direction-popup-btn-cancel {
    background: #f0f0f0;
    color: #333;
}
.attr-direction-popup-btn-cancel:hover {
    background: #e0e0e0;
}
@media (max-width: 940px) {
    .gm-style .gm-style-iw-c {
        max-width: 360px !important; /* Increased from 300px */
        max-height: 319px !important;

    }
    
    .attr-info-window {
        min-width: 320px;
        max-width: 340px;
    }
}

@media (max-width: 480px) {
    .gm-style .gm-style-iw-c {
        max-width: 226px !important; /* Wider for small phones */
    }
    
    .attr-info-window {
        min-width: 218px !important;
        max-width: 320px;
    }
}
/* Move map below listings on mobile */
@media (max-width: 768px) {
    .attr-main-layout {
        flex-direction: column-reverse; /* Changed from column to column-reverse */
    }
    
    .attr-sidebar {
        order: 1; /* Listings first */
    }
    
    .attr-map-container {
        order: 2; /* Map second (below listings) */
    }
}
.attr-clinic-locator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    position: relative;
    margin: 0 25px;
}

/* Search Section - Burgundy Header */
.attr-search-section {
    /* background: #951a44; */
    padding: 40px 20px 20px;
    display: flex;
    align-items: baseline;
}

.attr-search-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.attr-search-input {
    flex: 1;
    border: none;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    outline: none;
    border-radius: 4px;
    color: #666;
}

.attr-search-input::placeholder {
    color: #999;
}

.attr-clear-btn {
    position: absolute!important;
    right: 20px;
    background: none!important;
    border: none;
    color: #999!important;
    font-size: 20px!important;
    cursor: pointer;
    padding: 5px 10px;
}

.attr-clear-btn:hover {
    color: #666!important;
}

.attr-search-btn {
    position: absolute!important;
    right: 10px;
    background: none!important;
    border: none;
    color: #8B0000!important;
    cursor: pointer;
    padding: 8px!important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Radius Selection Container */
.attr_filter_and_location_container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    /* margin: 15px auto; */
    /* background: #951a44; */
    max-width: 1200px;
    gap: 20px;
}

/* Use Location Button */
.attr-use-location {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

#attr-use-my-location-image {
    width: 24px;
    height: 24px;
}

#attr-use-my-location-text {
    margin: 0;
    white-space: nowrap;
}

/* Radius Filter Section */
.attr-radius-filter-section {
    display: flex;
    align-items: center;
    gap: 20px;
    /* background: white; */
    border-radius: 4px;
    border: 2px solid #8B0000;
}

.attr-radius-label {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
}

.attr-radius-options {
    display: flex;
    gap: 15px;
}

.attr-radius-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 15px;
}

.attr-filter-radio {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #8B0000;
}

.attr-filter-label {
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
}

/* Main Layout */
.attr-main-layout {
    display: flex;
    height: 700px;
    position: relative;
}

/* Sidebar - Results */
.attr-sidebar {
    width: 420px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
}

.attr-results-header {
    padding: 11px;
    /* background: #951a44; */
    /* border-bottom: 2px solid #6B0000; */
    border-top: 1px solid white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.attr-results-count {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.attr-results-count span {
    color: white;
}

.attr-results-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

/* Loading State */
.attr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.attr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #8B0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.attr-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Result Items */
.attr-result-item {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    position: relative;
}

.attr-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    /* background: #8B0000; */
    opacity: 0;
    transition: opacity 0.2s;
}

.attr-result-item:hover {
    background: #f5f5f5;
}

.attr-result-item:hover::before {
    opacity: 0.3;
}

.attr-result-item.active {
    background: #fef5f5;
    border-left: 4px solid #8B0000;
    padding-left: 16px;
}

.attr-result-item.active::before {
    opacity: 1;
}

.attr-result-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.attr-result-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    line-height: 1.3;
}

.attr-result-distance {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 10px;
    font-weight: 500;
}

.attr-result-address {
    margin-bottom: 12px;
    line-height: 1.4;
}

.attr-result-contact {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.attr-result-contact div {
    margin-bottom: 4px;
}

.attr-result-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attr-result-btn {
    padding: 10px 20px!important;
    border: none;
    background: #8B0000;
    color: white;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.attr-result-btn:hover {
    background: #6B0000;
}

.attr-result-btn.primary {
    background: #8B0000;
    color: white;
}

.attr-result-btn.primary:hover {
    background: #6B0000;
}

/* Map Container */
.attr-map-container {
    flex: 1;
    position: relative;
    background: #e5e3df;
    min-width: 0;
}

.attr-map {
    width: 100%;
    height: 100%;
}

/* Map Controls */
.attr-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.attr-map-type-switch {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: flex;
    overflow: hidden;
}

.attr-map-type-btn {
    padding: 10px 20px;
    border: none;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.attr-map-type-btn:not(:last-child) {
    border-right: 1px solid #e0e0e0;
}

.attr-map-type-btn:hover {
    background: #f5f5f5;
}

.attr-map-type-btn.active {
    background: #8B0000;
    color: white;
}

.attr_listing_icons {
    position: relative;
    top: 3px;
}

/* Info Window Styling */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 400px;
}

.attr-info-window {
    padding: 12px;
    /* min-width: 300px; */
    max-width: 400px;
}

.attr-info-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.attr-info-distance {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
    font-weight: 500;
}

.attr-info-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.attr-info-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.attr-info-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.attr-info-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #8B0000;
    margin: 0 0 10px 0;
}

.attr-info-hours {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    font-size: 13px;
}

.attr-info-day {
    font-weight: 500;
    color: #666;
}

.attr-info-time {
    color: #333;
}

.attr-info-time.closed {
    color: #951a44 !important;
    font-weight: 500;
}

.attr-info-contact div {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.attr-info-buttons {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    flex-wrap: nowrap;
}

.attr-info-btn {
   
    min-width: 0;
    padding: 10px 6px!important;

    /* padding: 10px 16px!important; */
    border: none;
    background: #8B0000;
    color: white;
    font-size: 11px;
    white-space: nowrap; 
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
}

.attr-info-btn:hover {
    background: #6B0000;
}

.attr-info-btn.primary {
    /* background: #8B0000; */
    /* color: white; */
}

.attr-info-btn.primary:hover {
    background: #6B0000;
}
@media (max-width: 940px){
    .attr-info-btn {
        /* flex: 1 1 0; */
    }
}
@media (min-width: 940px){
    .attr-radius-filter-section{
        padding: 12px 20px!important;
    }
}

/* For small mobile screens - Optimize button sizing */
@media (max-width: 480px) {
    .attr-info-buttons {
        gap: 5px!important;
    }
    
    .attr-info-btn {
        padding: 10px 8px!important;
        font-size: 10px!important;
        /* flex:auto!important; */
    }
    .attr-radius-filter-section{
        padding: 0px!important;
    }
}

/* For tablets and medium screens - Keep buttons in one row but optimized */
@media only screen and (min-width: 481px) and (max-width: 940px) {
    .attr-info-buttons {
        gap: 6px!important;
    }
    
    .attr-info-btn {
        padding: 10px 23px!important;
        font-size: 11px!important;
    }
}
/* Ensure buttons wrap properly on very small popups */
@media (max-width: 340px) {
    .attr-info-buttons {
        flex-direction: column!important;
        flex-wrap: wrap!important;
        gap: 8px!important;
    }
    
    .attr-info-btn {
        width: 100%!important;
        flex: 1 1 100%!important;
        padding: 12px!important;
        font-size: 8px!important;
    }
}
/* Responsive Design */
@media (max-width: 1024px) {
    .attr-sidebar {
        width: 350px;
    }
}

@media (max-width: 400px) {
    .attr_filter_and_location_container {
        padding: 0 15px!important;
    }
}

@media (max-width: 768px) {
    .attr-search-section {
        padding: 25px 15px 15px;
        display: block!important;
    }
    
    .attr_filter_and_location_container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        margin: 15px auto;
    }
    
    .attr-use-location {
        width: 100%;
        justify-content: center;
        padding: 12px;
        background: rgba(139, 0, 0, 0.1);
        border-radius: 4px;
    }
    
    .attr-radius-filter-section {
        width: 100%;
        /* flex-direction: column; */
        gap: 10px;
        align-items: flex-start;
    }
    
    .attr-radius-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .attr-main-layout {
        flex-direction: column-reverse;
        height: auto;
    }
    
    .attr-sidebar {
        width: 100%;
        height: 400px;
        order: 2;
    }
    
    .attr-map-container {
        height: 500px;
        min-height: 500px;
        width: 100%;
        order: 1;
        position: relative !important;
    }
    
    .attr-map {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0;
        left: 0;
    }
    
    .attr-map-controls {
        top: 15px;
        right: 15px;
    }
    .attr-radius-option{
        padding: 6px!important;
    }
}

@media (max-width: 480px) {
    .attr-search-input {
        padding: 14px 50px 14px 15px;
        font-size: 15px;
    }
    
    .attr-sidebar {
        height: 450px;
    }
    
    .attr-map-container {
        height: 450px;
        min-height: 450px;
    }
    
    .attr-results-header {
        padding: 15px;
    }
    
    .attr-result-item {
        padding: 15px;
    }
    
    .attr-result-buttons {
        flex-direction: column;
    }
    
    .attr-result-btn {
        width: 100%;
        text-align: center;
    }
    
    .attr-radius-options {
        /* flex-direction: column; */
        width: 100%;
        gap: 3px;
    }
    
    .attr-radius-option {
        /* width: 100%; */
        padding: 1px!important;
        /* background: #f5f5f5; */
        border-radius: 4px;
    }
    .attr-filter-radio {
        width: 10px;
        height: 10px;
       
    }
}
@media (max-width: 365px) {
    .attr-radius-options {
        flex-direction: column!important;
      
    }
}
/* Print Styles */
@media print {
    .attr-search-section,
    .attr-map-container,
    .attr-map-controls {
        display: none !important;
    }
    
    .attr-main-layout {
        height: auto;
    }
    
    .attr-sidebar {
        width: 100%;
        height: auto;
    }
    
    .attr-results-list {
        overflow: visible;
    }
    
    .attr-result-item {
        page-break-inside: avoid;
    }
}