/**
 * Frosbe Locations - Frontend Styles
 */

/* Map Container */
.frosbe-map-container {
    width: 100%;
    margin-bottom: 20px;
}

.frosbe-map {
    width: 100%;
    min-height: 400px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

/* Radius Filter Bar */
.frosbe-radius-filter {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px 16px;
}

.frosbe-radius-filter-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.frosbe-radius-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.frosbe-radius-location-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.frosbe-radius-location-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.frosbe-radius-location-input::placeholder {
    color: #9ca3af;
}

.frosbe-radius-locate-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f97316;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    transition: background-color 0.2s;
}

.frosbe-radius-locate-btn:hover {
    background: #ea580c;
}

.frosbe-radius-locate-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.frosbe-radius-locate-btn svg {
    width: 16px;
    height: 16px;
}

.frosbe-radius-select {
    padding: 10px 32px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 8px center/16px no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    min-width: 100px;
}
.frosbe-radius-buttons{
    display: flex;
    gap: 8px;
    width: 100%;
}
.frosbe-radius-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.frosbe-radius-search-btn {
    padding: 10px 24px;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 100% !important;
}

.frosbe-radius-search-btn:hover {
    background: #ea580c;
}

.frosbe-radius-reset-btn {
    padding: 10px 24px;
    background: #6b7280;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 100% !important;
}

.frosbe-radius-reset-btn:hover {
    background: #4b5563;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pac-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
}

.pac-item:hover {
    background: #f9fafb;
}

.pac-item-selected {
    background: #fff7ed;
}

.pac-icon {
    display: none;
}

.pac-item-query {
    font-weight: 500;
    color: #1f2937;
}

/* Info Window / Popup - Clean Modern Design */
.frosbe-info-window {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    padding: 8px 0 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.frosbe-popup-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.frosbe-popup-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.frosbe-popup-title {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
}

.frosbe-popup-cta {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.frosbe-popup-cta:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.frosbe-popup-cta:active {
    transform: translateY(0);
}

/* Locations List */
.frosbe-locations-list,
.frosbe-locations-list-container {
    margin-top: 24px;
}

.frosbe-locations-list.loading {
    opacity: 0.5;
    pointer-events: none;
}

.frosbe-list-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.frosbe-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.frosbe-list-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.frosbe-list-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frosbe-list-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.frosbe-list-content {
    flex: 1;
    min-width: 0;
}

.frosbe-list-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.frosbe-list-title a {
    color: inherit;
    text-decoration: none;
}

.frosbe-list-item:hover .frosbe-list-title {
    color: #2563eb;
}

.frosbe-list-address {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    white-space: unset;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frosbe-list-description {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* Pagination */
.frosbe-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.frosbe-page-btn {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.frosbe-page-btn:hover {
    background: #f5f5f5;
    border-color: #0073aa;
}

.frosbe-page-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Google Maps InfoWindow overrides */
.gm-style-iw {
    max-width: none !important;
}

.gm-style-iw-c {
    padding: 16px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

.gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style-iw-tc::after {
    background: #fff !important;
}

/* Close button styling */
.gm-style-iw-c button.gm-ui-hover-effect {
    position: absolute !important;
    top: 8px !important;
    right: 9px !important;
    width: 28px !important;
    height: 28px !important;
    background: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.gm-style-iw-c button.gm-ui-hover-effect:hover {
    background: #f3f4f6 !important;
}

.gm-style-iw-c button.gm-ui-hover-effect > span {
    margin: 0 !important;
    background-color: #6b7280 !important;
}

.gm-style-iw-c button.gm-ui-hover-effect:hover > span {
    background-color: #1f2937 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .frosbe-map {
        min-height: 300px;
    }

    .frosbe-list-items {
        grid-template-columns: 1fr;
    }

    .frosbe-list-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .frosbe-list-icon {
        width: 40px;
        height: 40px;
    }

    .frosbe-info-window {
        width: 180px;
    }

    .frosbe-popup-icon {
        width: 44px;
        height: 44px;
    }

    .frosbe-popup-title {
        font-size: 14px;
    }

    .frosbe-popup-cta {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Radius filter responsive */
    .frosbe-radius-filter {
        padding: 10px 12px;
    }

    .frosbe-radius-filter-inner {
        gap: 8px;
    }

    .frosbe-radius-input-wrapper {
        min-width: 100%;
        order: 1;
    }

    .frosbe-radius-select {
        flex: 1;
        order: 2;
    }

    .frosbe-radius-search-btn,
    .frosbe-radius-reset-btn {
        flex: 1;
        order: 3;
        padding: 10px 16px;
    }
}

/* Single Location Page */
.frosbe-location-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.frosbe-location-header {
    margin-bottom: 30px;
}

.frosbe-location-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.frosbe-location-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.frosbe-location-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.frosbe-location-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.frosbe-location-description {
    font-size: 16px;
    line-height: 1.7;
}

.frosbe-location-sidebar {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.frosbe-location-sidebar h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
}

.frosbe-location-details {
    list-style: none;
    padding: 0;
    margin: 0;
}

.frosbe-location-details li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.frosbe-location-details li:last-child {
    border-bottom: none;
}

.frosbe-location-details strong {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .frosbe-location-content {
        grid-template-columns: 1fr;
    }

    .frosbe-location-title {
        font-size: 24px;
    }
}
