/**
 * Frontend Styles for Google Map Cluster
 * 
 * @package GoogleMapCluster
 */

/* Map Wrapper */
.gmc-map-wrapper {
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

/* Map Container */
.gmc-map-container {
    position: relative;
    min-height: 300px;
    background: #f5f5f5;
}

/* Loading State */
.gmc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    background: #f9f9f9;
    color: #666;
    font-size: 16px;
}

.gmc-loading p {
    margin: 0;
    padding: 20px;
}

/* Error States */
.gmc-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.gmc-no-data {
    padding: 20px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

.gmc-no-businesses {
    padding: 15px;
    background: #e2e3e5;
    color: #383d41;
    text-align: center;
    border-top: 1px solid #ddd;
}

/* Filter Controls */
.gmc-filter-controls {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.gmc-filter-controls h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.gmc-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gmc-filter-checkboxes label {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.gmc-filter-checkboxes label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.gmc-filter-checkboxes input[type="checkbox"] {
    margin-right: 6px;
}

.gmc-filter-all {
    font-weight: 600;
    background: #007cba !important;
    color: #fff !important;
    border-color: #005a87 !important;
}

.gmc-filter-all:hover {
    background: #005a87 !important;
}

/* Category count styling */
.gmc-category-count {
    font-weight: normal;
    opacity: 0.8;
    font-size: 12px;
}

/* Filter no results message */
.gmc-filter-no-results {
    padding: 15px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

.gmc-filter-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Enhanced filter controls */
.gmc-filter-controls {
    position: relative;
}

.gmc-filter-controls::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd 20%, #ddd 80%, transparent);
}

/* Filter checkbox animations */
.gmc-filter-checkboxes input[type="checkbox"] {
    transition: all 0.2s ease;
}

.gmc-filter-checkboxes label {
    position: relative;
    overflow: hidden;
}

.gmc-filter-checkboxes label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.gmc-filter-checkboxes label:hover::before {
    left: 100%;
}

/* Info Window Styles - New Template System */
.gmc-info-window {
    max-width: 300px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.gmc-info-window .gmc-business-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.gmc-info-window .gmc-business-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gmc-info-window .gmc-business-address,
.gmc-info-window .gmc-business-phone,
.gmc-info-window .gmc-business-website {
    font-size: 14px;
    line-height: 1.4;
}

.gmc-info-window .gmc-business-address strong,
.gmc-info-window .gmc-business-phone strong,
.gmc-info-window .gmc-business-website strong {
    font-weight: 600;
    color: #333;
}

.gmc-info-window .gmc-address-link {
    color: #007cba;
    text-decoration: none;
}

.gmc-info-window .gmc-address-link:hover {
    text-decoration: underline;
}

.gmc-info-window .gmc-phone-link {
    color: #007cba;
    text-decoration: none;
}

.gmc-info-window .gmc-phone-link:hover {
    text-decoration: underline;
}

.gmc-info-window .gmc-website-link {
    display: inline-block;
    padding: 5px 10px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 5px;
}

.gmc-info-window .gmc-website-link:hover {
    background: #005a87;
}

/* Legacy Tooltip Styles - Kept for backward compatibility */
.gmc-tooltip {
    max-width: 300px;
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gmc-tooltip h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.gmc-tooltip p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.gmc-tooltip .address {
    color: #666;
    font-style: italic;
}

.gmc-tooltip .phone a {
    color: #007cba;
    text-decoration: none;
}

.gmc-tooltip .phone a:hover {
    text-decoration: underline;
}

.gmc-tooltip .website a {
    display: inline-block;
    padding: 5px 10px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 5px;
}

.gmc-tooltip .website a:hover {
    background: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gmc-map-wrapper {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .gmc-map-container {
        min-height: 250px;
    }

    .gmc-filter-controls {
        padding: 10px;
    }

    .gmc-filter-checkboxes {
        flex-direction: column;
        gap: 5px;
    }

    .gmc-filter-checkboxes label {
        justify-content: flex-start;
        padding: 8px 10px;
    }

    .gmc-info-window {
        max-width: 250px;
    }

    .gmc-info-window .gmc-business-title {
        font-size: 14px;
    }

    .gmc-info-window .gmc-business-address,
    .gmc-info-window .gmc-business-phone,
    .gmc-info-window .gmc-business-website {
        font-size: 13px;
    }

    .poi-info-window .gm-title {
        font-size: 14px !important;
    }

    .poi-info-window .address-line {
        font-size: 13px !important;
    }

    .gmc-tooltip {
        max-width: 250px;
        padding: 8px;
    }

    .gmc-tooltip h4 {
        font-size: 14px;
    }

    .gmc-tooltip p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .gmc-map-container {
        min-height: 200px;
    }

    .gmc-loading {
        min-height: 200px;
        font-size: 14px;
    }

    .gmc-info-window {
        max-width: 200px;
    }

    .gmc-tooltip {
        max-width: 200px;
    }
}

/* Google Maps UI Adjustments */
.gmc-map-container .gm-style-iw {
    padding: 0;
}

.gmc-map-container .gm-style-iw-c {
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gmc-map-container .gm-style-iw-d {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}




.gm-style .gm-style-iw-c {
    flex-direction: row-reverse !important;
}

.gm-style-iw-d {
    padding: 20px !important;
}

.gm-style-iw-d .gmc-info-window {
    padding: 0 !important;
}

.gm-style-iw-d .gmc-info-window .gmc-business-title {
    margin-top: 0 !important;
}

.gm-style-iw-d .poi-info-window {
    padding: 0 !important;
}

/* Google POI Info Window Styling - Match custom template design */
.poi-info-window {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.poi-info-window > div {
    padding: 0 !important;
    margin: 0 !important;
}

.poi-info-window .gm-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin: 0 0 16px 0 !important;
    line-height: 1.3 !important;
    padding: 0 !important;
}

.poi-info-window .gm-full-width {
    width: 100% !important;
}

.poi-info-window .transit-container {
    margin-bottom: 16px !important;
}

.poi-info-window .address {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #333 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    display: block !important;
}

.poi-info-window .address-line {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #333 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.poi-info-window .view-link {
    margin-top: 16px !important;
    padding: 0 !important;
}

.poi-info-window .view-link a {
    display: inline-block !important;
    padding: 10px 16px !important;
    background: #007cba !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: background-color 0.2s ease !important;
}

.poi-info-window .view-link a:hover {
    background: #005a87 !important;
}

.poi-info-window .view-link span {
    color: #fff !important;
    font-weight: 600 !important;
}







/* Cluster Styles */
.cluster {
    background: #007cba;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cluster.cluster-small {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.cluster.cluster-medium {
    width: 40px;
    height: 40px;
    font-size: 12px;
    background: #005a87;
}

.cluster.cluster-large {
    width: 50px;
    height: 50px;
    font-size: 14px;
    background: #003f5c;
}

/* Accessibility */
.gmc-filter-checkboxes label:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.gmc-map-container:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Screen reader only content */
.hide508 {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Default Info Window Styles (for Google Maps markers without custom templates) */
.gmc-info-default {
    /* Inherits all styles from .gmc-info-window */
}

.gmc-info-default .gmc-business-title {
    /* Inherits title styling from .gmc-info-window .gmc-business-title */
}

.gmc-info-default .gmc-business-details {
    /* Inherits details styling from .gmc-info-window .gmc-business-details */
}

/* Print Styles */
@media print {
    .gmc-filter-controls {
        display: none;
    }

    .gmc-map-container {
        border: 1px solid #000;
        background: #fff;
    }
}
