/* Fullscreen map container */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
}

#county-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Clean info window styles */
.custom-info-window {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 300px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Remove default focus styles from InfoWindow elements */
.gm-style .gm-style-iw-c {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.gm-style .gm-style-iw-t::after {
    outline: none !important;
}

/* Remove any highlight from InfoWindow content */
.gm-style-iw.gm-style-iw-c *::selection {
    background: transparent;
}

.gm-style-iw.gm-style-iw-c *::-moz-selection {
    background: transparent;
}

/* Ensure no highlight on touch devices */
.gm-style-iw.gm-style-iw-c * {
    -webkit-tap-highlight-color: transparent !important;
    user-select: none;
}

.info-window-header-image {
    width: 100%;
    display: block;
    border-bottom: 1px solid #eee;
}

.info-window-header-image img {
    width: 100%;
    height: auto;
    display: block;
}

.info-window-content {
    padding: 12px 5px;
}

.info-window-title {
    font-size: 15px;
    font-weight: 600;
    color: #002147;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-window-address {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* Custom focus styles for links */
.info-window-address a,
.service-item a,
.other-locations a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: color 0.2s;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    /* Remove default outline and tap highlight */
}

/* Subtle hover effect instead of focus outline */
.info-window-address a:focus,
.service-item a:focus,
.other-locations a:focus {
    background: transparent;
    box-shadow: none;
}

.info-window-address a:hover,
.service-item a:hover,
.other-locations a:hover {
    color: #0066cc;
}

.info-window-services {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.service-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.info-window-footer {
    font-size: 13px;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 12px;
    padding-top: 12px;
}

.license-number {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.other-locations {
    margin-top: 12px;
}

/* Override Google Maps InfoWindow close button */
.gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
    opacity: 0.7 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    transition: opacity 0.2s !important;
}

.gm-ui-hover-effect:hover,
.gm-ui-hover-effect:focus {
    opacity: 1 !important;
}

.gm-ui-hover-effect img {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    opacity: 1 !important;
}

/* Loading indicator styles */
.map-loading {
    background-color: rgba(255, 255, 255, 0.95) !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    color: #333 !important;
    display: flex;
    align-items: center !important;
    gap: 8px !important;
}

.map-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Legend styles */
.map-legend {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.legend-title {
    font-size: 16px;
    font-weight: 600;
    color: #002147;
    margin-bottom: 12px;
    text-align: center;
}

.legend-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.legend-branch {
    border-left: 4px solid transparent;
    padding: 8px 12px;
    border-radius: 4px;
    background: #f8f9fa;
}

.branch-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.branch-counties {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.county-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.county-label {
    font-size: 12px;
    color: #666;
}

/* Map container styles */
.mapapi-app {
    margin-bottom: 30px;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

.map-error {
    padding: 20px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
}

.mapapi-app iframe {
    display: block;
    border: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}