/**
 * SHC Clinic Locator Styles
 * 
 * Untitled UI Design System
 * Clean, modern, enterprise-grade
 *
 * @package ShcClinicLocator
 */

/* ==========================================================================
   CSS Variables (Untitled UI Tokens)
   ========================================================================== */

/* Prevent FOUC - hide until CSS loaded */
.shc-clinic-locator {
    --cl-primary-600: #7F56D9;
    --cl-primary-700: #6941C6;
    --cl-primary-50: #F9F5FF;
    
    --cl-gray-25: #FCFCFD;
    --cl-gray-50: #F9FAFB;
    --cl-gray-100: #F2F4F7;
    --cl-gray-200: #EAECF0;
    --cl-gray-300: #D0D5DD;
    --cl-gray-400: #98A2B3;
    --cl-gray-500: #667085;
    --cl-gray-600: #475467;
    --cl-gray-700: #344054;
    --cl-gray-900: #101828;
    
    --cl-white: #FFFFFF;
    
    --cl-shadow-xs: 0px 1px 2px rgba(16, 24, 40, 0.05);
    --cl-shadow-sm: 0px 1px 2px rgba(16, 24, 40, 0.06), 0px 1px 3px rgba(16, 24, 40, 0.1);
    --cl-shadow-md: 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06);
    --cl-shadow-lg: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
    
    --cl-radius-sm: 6px;
    --cl-radius-md: 8px;
    --cl-radius-lg: 12px;
    
    --cl-font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    
    font-family: var(--cl-font-family);
    color: var(--cl-gray-900);
    line-height: 1.5;
    
    /* Shortcode spacing */
    padding: 32px 0;
}

/* ==========================================================================
   Search Bar - Untitled UI Style
   ========================================================================== */

.shc-cl-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.shc-cl-search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.shc-clinic-locator .shc-cl-search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    color: #667085 !important;
    pointer-events: none !important;
    display: block !important;
    z-index: 1 !important;
}

.shc-clinic-locator .shc-cl-search-input,
.shc-clinic-locator input.shc-cl-search-input,
.shc-clinic-locator input[type="text"].shc-cl-search-input {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 44px 10px 42px !important;
    border: 1px solid #D0D5DD !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #101828 !important;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.shc-clinic-locator .shc-cl-search-input::placeholder,
.shc-clinic-locator input.shc-cl-search-input::placeholder {
    color: #667085 !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

.shc-clinic-locator .shc-cl-search-input:focus,
.shc-clinic-locator input.shc-cl-search-input:focus,
.shc-clinic-locator input[type="text"].shc-cl-search-input:focus {
    outline: none !important;
    border-color: #7F56D9 !important;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #F4EBFF !important;
}

.shc-clinic-locator .shc-cl-clear-btn,
.shc-clinic-locator button.shc-cl-clear-btn {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: transparent !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #98A2B3 !important;
    transition: color 0.15s ease !important;
    padding: 0 !important;
    z-index: 1 !important;
}

.shc-clinic-locator .shc-cl-clear-btn:hover {
    color: #475467 !important;
}

.shc-clinic-locator .shc-cl-clear-btn svg {
    width: 18px !important;
    height: 18px !important;
}

/* Near Me Button - Untitled UI Secondary */
.shc-clinic-locator .shc-cl-near-btn,
.shc-clinic-locator button.shc-cl-near-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 44px !important;
    padding: 0 16px !important;
    border: 1px solid #D0D5DD !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #344054 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05) !important;
    transition: all 0.15s ease !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.shc-clinic-locator .shc-cl-near-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    color: #344054 !important;
}

.shc-clinic-locator .shc-cl-near-btn:hover,
.shc-clinic-locator button.shc-cl-near-btn:hover {
    background: #F9FAFB !important;
    border-color: #D0D5DD !important;
    color: #1D2939 !important;
}

.shc-clinic-locator .shc-cl-near-btn.active {
    background: #F9F5FF !important;
    border-color: #7F56D9 !important;
    color: #6941C6 !important;
}

.shc-clinic-locator .shc-cl-near-btn.active svg {
    color: #7F56D9 !important;
}

.shc-cl-near-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.shc-cl-near-btn.loading svg {
    animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   Results Bar
   ========================================================================== */

.shc-cl-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--cl-gray-50);
    border-radius: var(--cl-radius-md);
}

.shc-cl-results-count {
    font-size: 14px;
    color: var(--cl-gray-600);
}

.shc-cl-count-number {
    font-weight: 600;
    color: var(--cl-gray-900);
}

.shc-cl-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--cl-radius-sm);
    background: var(--cl-white);
    font-size: 13px;
    font-weight: 500;
    color: var(--cl-primary-600);
    cursor: pointer;
    transition: background 0.15s ease;
}

.shc-cl-reset-btn:hover {
    background: var(--cl-primary-50);
}

/* ==========================================================================
   Map Container
   ========================================================================== */

.shc-cl-map-container {
    position: relative;
    border-radius: var(--cl-radius-lg);
    overflow: hidden;
    box-shadow: var(--cl-shadow-md);
}

.shc-cl-map {
    width: 100%;
    min-height: 500px;
}

.shc-cl-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--cl-gray-50);
    color: var(--cl-gray-500);
    font-size: 14px;
    z-index: 10;
}

.shc-cl-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--cl-gray-200);
    border-top-color: var(--cl-primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Info Window (Google Maps Popup) - Untitled UI Style
   ========================================================================== */

.shc-cl-info-window {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    padding: 0;
    min-width: 220px;
    max-width: 300px;
}

.shc-cl-iw-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    line-height: 1.4;
    letter-spacing: -0.01em;
    padding-right: 20px;
}

.shc-cl-iw-address {
    font-size: 14px;
    color: #475467;
    margin-bottom: 12px;
    line-height: 1.45;
}

.shc-cl-iw-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
}

.shc-cl-iw-phone,
.shc-cl-iw-email {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #344054;
    margin: 0;
}

.shc-cl-iw-phone svg,
.shc-cl-iw-email svg {
    width: 16px;
    height: 16px;
    color: #667085;
    flex-shrink: 0;
}

.shc-cl-iw-phone a,
.shc-cl-iw-email a {
    color: #344054;
    text-decoration: none;
    transition: color 0.15s ease;
}

.shc-cl-iw-phone a:hover,
.shc-cl-iw-email a:hover {
    color: #7F56D9;
}

.shc-cl-iw-directions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 18px;
    background: #7F56D9;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
}

.shc-cl-iw-directions:hover {
    background: #6941C6;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #F4EBFF;
}

/* Override Google Maps default popup styles */
.gm-style-iw {
    padding: 0 !important;
}

.gm-style-iw-c {
    padding: 16px !important;
    padding-top: 12px !important;
    border-radius: 12px !important;
    box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05) !important;
    max-width: 340px !important;
}

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

.gm-style-iw-tc::after {
    background: #fff !important;
}

/* Close button - clean style */
.gm-style-iw-c button.gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    opacity: 0.6 !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.gm-style-iw-c button.gm-ui-hover-effect:hover {
    opacity: 1 !important;
    background: none !important;
}

.gm-style-iw-c button.gm-ui-hover-effect > span {
    background-color: #667085 !important;
    margin: 0 !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .shc-cl-search-bar {
        flex-direction: column;
    }

    .shc-cl-near-btn {
        width: 100%;
        justify-content: center;
    }

    .shc-cl-map {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .shc-cl-results-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .shc-cl-map {
        min-height: 350px;
    }
}
