 @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

 * {
     box-sizing: border-box;
 }

 .map-container {
     position: relative;
     width: 100%;
     font-family: 'Open Sans', sans-serif;
 }

 #map {
     border-radius: 8px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
 }

 .map-popup {
     position: absolute;
     background: white;
     border-radius: 12px;
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
     padding: 20px;
     min-width: 320px;
     max-width: 380px;
     z-index: 1000;
     animation: popupSlideUp 0.3s ease-out;
     pointer-events: auto;
 }

 @keyframes popupSlideUp {
     from {
         opacity: 0;
         transform: translateY(10px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 .popup-arrow {
     position: absolute;
     bottom: -10px;
     left: 50%;
     transform: translateX(-50%);
     width: 0;
     height: 0;
     border-left: 12px solid transparent;
     border-right: 12px solid transparent;
     border-top: 12px solid white;
     filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.1));
 }

 .popup-close {
     position: absolute;
     top: 12px;
     right: 12px;
     background: #f5f5f5;
     border: none;
     font-size: 20px;
     cursor: pointer;
     color: #666;
     line-height: 1;
     padding: 0;
     width: 28px;
     height: 28px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s;
     z-index: 10;
 }

 .popup-close:hover {
     background: #e0e0e0;
     color: #333;
     transform: rotate(90deg);
 }

 .popup-header {
     display: flex;
     justify-content: space-between;
     align-items: flex-start;
     margin-bottom: 16px;
     gap: 12px;
     padding-right: 24px;
 }

 .popup-info {
     flex: 1;
     min-width: 0;
 }

 .popup-header .provider-name {
     font-size: 18px;
     font-weight: 700;
     margin: 0 0 4px 0;
     color: #333;
     line-height: 1.3;
 }

 .popup-header .provider-role {
     font-size: 12px;
     font-weight: 400;
     margin: 0;
     color: #666;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }

 .popup-header .practice-logo {
     max-width: 60px;
     max-height: 60px;
     object-fit: contain;
     flex-shrink: 0;
     background: #f9f9f9;
     border-radius: 6px;
     padding: 6px;
 }

 .popup-contact {
     margin: 16px 0;
     padding: 14px;
     background: #f8f9fa;
     border-radius: 8px;
 }

 .popup-contact .contact-item {
     display: flex;
     align-items: flex-start;
     margin: 8px 0;
     font-size: 13px;
     color: #444;
     line-height: 1.5;
 }

 .popup-contact .contact-item:first-child {
     margin-top: 0;
 }

 .popup-contact .contact-item:last-child {
     margin-bottom: 0;
 }

 .popup-contact .contact-item i {
     margin-right: 10px;
     font-size: 14px;
     flex-shrink: 0;
     opacity: 0.7;
     margin-top: 1px;
 }

 .popup-navigation {
     display: flex;
     align-items: center;
     justify-content: center;
     margin: 16px 0;
     gap: 12px;
     padding: 12px;
     background: #f8f9fa;
     border-radius: 8px;
 }

 .popup-navigation .nav-arrow {
     background: #59BEE2;
     color: white;
     border: none;
     width: 32px;
     height: 32px;
     border-radius: 50%;
     font-size: 20px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s;
     font-weight: bold;
     line-height: 1;
     outline: none;
 }

 .popup-navigation .nav-arrow:hover:not(:disabled) {
     background: #134D8D;
     transform: scale(1.1);
 }

 .popup-navigation .nav-arrow:disabled {
     background: #ccc;
     cursor: not-allowed;
     opacity: 0.5;
 }

 .popup-navigation .provider-counter {
     font-weight: 600;
     color: #555;
     min-width: 45px;
     text-align: center;
     font-size: 13px;
 }

 .view-full-profile-btn {
     display: block;
     width: 100%;
     padding: 12px;
     background: #59BEE2;
     color: white;
     text-align: center;
     border: none;
     border-radius: 8px;
     font-weight: 600;
     font-size: 13px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     margin-top: 4px;
     cursor: pointer;
     transition: all 0.2s;
     font-family: 'Open Sans', sans-serif;
 }

 .view-full-profile-btn:hover {
     background: #134D8D;
     transform: translateY(-1px);
     box-shadow: 0 4px 12px rgba(0, 169, 165, 0.3);
 }

 .modal-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.6);
     z-index: 999;
     backdrop-filter: blur(2px);
 }

 .profile-modal {
     position: fixed;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     background: white;
     border-radius: 16px;
     box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
     z-index: 1001;
     max-width: 600px;
     width: 92%;
     max-height: 90vh;
     overflow-y: auto;
     animation: modalSlideIn 0.3s ease-out;
 }

 @keyframes modalSlideIn {
     from {
         opacity: 0;
         transform: translate(-50%, -48%);
     }

     to {
         opacity: 1;
         transform: translate(-50%, -50%);
     }
 }

 .profile-content.full {
     padding: 36px 32px;
 }

 .close-btn {
     position: absolute;
     top: 16px;
     right: 16px;
     background: #f5f5f5;
     border: none;
     font-size: 24px;
     cursor: pointer;
     color: #666;
     line-height: 1;
     padding: 0;
     width: 32px;
     height: 32px;
     border-radius: 50%;
     z-index: 10;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s;
 }

 .close-btn:hover {
     background: #e0e0e0;
     color: #333;
     transform: rotate(90deg);
 }

 .full-profile-header {
     margin-bottom: 24px;
     padding-bottom: 16px;
     border-bottom: 2px solid #59BEE2;
 }

 .full-profile-header h2 {
     font-size: 20px;
     font-weight: 600;
     color: #59BEE2;
     margin: 0;
 }

 .provider-block,
 .practice-block {
     background: #f8f9fa;
     padding: 24px;
     border-radius: 12px;
     margin-bottom: 16px;
 }

 .provider-details {
     display: flex;
     gap: 20px;
     align-items: flex-start;
 }

 .provider-photo {
     width: 100px;
     height: 100px;
     border-radius: 50%;
     object-fit: cover;
     flex-shrink: 0;
     border: 3px solid white;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
 }

 .provider-info {
     flex: 1;
     min-width: 0;
 }

 .provider-info .provider-name {
     font-size: 20px;
     font-weight: 700;
     margin: 0 0 4px 0;
     color: #333;
 }

 .provider-info .provider-role {
     font-size: 13px;
     font-weight: 400;
     margin: 0 0 12px 0;
     color: #666;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }

 .provider-info .contact-item,
 .practice-info .contact-item {
     display: flex;
     align-items: flex-start;
     margin: 8px 0;
     font-size: 14px;
     color: #444;
     line-height: 1.6;
 }

 .contact-item i {
     margin-right: 10px;
     font-size: 16px;
     flex-shrink: 0;
     opacity: 0.7;
     margin-top: 2px;
 }

 .contact-item a {
     color: #59BEE2;
     text-decoration: none;
     word-break: break-word;
 }

 .contact-item a:hover {
     text-decoration: underline;
 }

 .practice-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 16px;
     gap: 16px;
 }

 .practice-name {
     font-size: 18px;
     font-weight: 700;
     margin: 0;
     color: #333;
     flex: 1;
     text-align: center;
 }

 .practice-navigation {
     display: flex;
     align-items: center;
     gap: 10px;
     flex-shrink: 0;
 }

 .practice-navigation .nav-arrow {
     background: #59BEE2;
     color: white;
     border: none;
     width: 30px;
     height: 30px;
     border-radius: 50%;
     font-size: 18px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s;
     font-weight: bold;
 }

 .practice-navigation .nav-arrow:hover:not(:disabled) {
     background: #134D8D;
     transform: scale(1.1);
 }

 .practice-navigation .nav-arrow:disabled {
     background: #ccc;
     cursor: not-allowed;
     opacity: 0.5;
 }

 .practice-navigation .practice-counter {
     font-weight: 600;
     color: #555;
     min-width: 40px;
     text-align: center;
     font-size: 13px;
 }

 .practice-details {
     display: flex;
     gap: 20px;
     align-items: flex-start;
 }

 .practice-details .practice-logo {
     max-width: 80px;
     max-height: 80px;
     object-fit: contain;
     flex-shrink: 0;
     background: #f9f9f9;
     border-radius: 8px;
     padding: 8px;
 }

 .practice-info {
     flex: 1;
     min-width: 0;
 }

 .view-full-profile-btn-modal {
     display: block;
     width: 100%;
     padding: 14px;
     background: #59BEE2;
     color: white;
     text-align: center;
     border: none;
     border-radius: 8px;
     font-weight: 600;
     font-size: 14px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     margin-top: 24px;
     cursor: pointer;
     transition: all 0.2s;
     font-family: 'Open Sans', sans-serif;
 }

 .view-full-profile-btn-modal:hover {
     background: #134D8D;
     transform: translateY(-2px);
     box-shadow: 0 4px 12px rgba(0, 169, 165, 0.3);
 }

 @media (max-width: 640px) {
     .map-popup {
         min-width: 280px;
         max-width: 90vw;
         padding: 16px;
     }

     .popup-header .provider-name {
         font-size: 16px;
     }

     .provider-details,
     .practice-details {
         flex-direction: column;
         align-items: center;
         text-align: center;
     }

     .profile-modal {
         width: 96%;
         max-height: 94vh;
     }

     .practice-header {
         flex-direction: column;
         align-items: stretch;
     }

     .practice-navigation {
         justify-content: center;
     }
 }

 /* Scrollbar styling */
 .profile-modal::-webkit-scrollbar {
     width: 8px;
 }

 .profile-modal::-webkit-scrollbar-track {
     background: #f1f1f1;
     border-radius: 0 16px 16px 0;
 }

 .profile-modal::-webkit-scrollbar-thumb {
     background: #59BEE2;
     border-radius: 4px;
 }

 .profile-modal::-webkit-scrollbar-thumb:hover {
     background: #134D8D;
 }

 .map-search-container {
     position: absolute;
     top: 10px;
     left: 50%;
     transform: translateX(-50%);
     z-index: 998;
     width: 90%;
     max-width: 500px;
 }

 .search-box {
     position: relative;
     display: flex;
     align-items: center;
     background: white;
     border-radius: 8px;
     box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
     overflow: visible;
 }

 .search-input {
     flex: 1;
     border: none;
     padding: 14px 16px;
     font-size: 15px;
     outline: none;
     font-family: inherit;
     border-radius: 8px;
 }

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

 .clear-search-btn {
     background: none;
     border: none;
     padding: 12px;
     cursor: pointer;
     color: #999;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: color 0.2s;
 }

 .clear-search-btn:hover {
     color: #666;
 }

 .distance-filter-inline {
     border-left: 1px solid #e5e5e5;
     padding: 0 12px;
     display: flex;
     align-items: center;
 }

 .distance-filter-inline select {
     padding: 8px 12px;
     border: 1px solid #ddd;
     border-radius: 4px;
     font-size: 14px;
     cursor: pointer;
     background: white;
     color: #333;
     min-width: 80px;
 }

 .results-count-bar {
     background: white;
     padding: 8px 16px;
     border-radius: 8px;
     box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
     margin-top: 8px;
     text-align: center;
 }

 .results-count {
     color: #666;
     font-size: 13px;
     font-weight: 500;
 }

 .search-results-panel {
     position: absolute;
     top: 10px;
     right: 10px;
     width: 320px;
     max-height: 580px;
     background: white;
     border-radius: 12px;
     box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
     z-index: 999;
     display: flex;
     flex-direction: column;
     overflow: hidden;
 }

 .results-header {
     padding: 16px 20px;
     border-bottom: 1px solid #e5e5e5;
     display: flex;
     justify-content: space-between;
     align-items: center;
     background: #f8f9fa;
 }

 .results-header h3 {
     margin: 0;
     font-size: 16px;
     font-weight: 600;
     color: #333;
 }

 .close-results-btn {
     background: none;
     border: none;
     font-size: 28px;
     color: #999;
     cursor: pointer;
     padding: 0;
     width: 30px;
     height: 30px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     transition: all 0.2s;
 }

 .close-results-btn:hover {
     background: #e5e5e5;
     color: #333;
 }

 .results-list {
     overflow-y: auto;
     max-height: 520px;
     flex: 1;
 }

 .result-item {
     padding: 16px 20px;
     border-bottom: 1px solid #f0f0f0;
     cursor: pointer;
     transition: background 0.2s;
 }

 .result-item:hover {
     background: #f8f9fa;
 }

 .result-item:last-child {
     border-bottom: none;
 }

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

 .result-name {
     font-weight: 600;
     font-size: 15px;
     color: #333;
     margin: 0 0 4px 0;
 }

 .result-role {
     font-size: 13px;
     color: #666;
     margin: 0;
 }

 .result-distance {
     background: #149BC6;
     color: white;
     padding: 4px 10px;
     border-radius: 12px;
     font-size: 12px;
     font-weight: 500;
     white-space: nowrap;
 }

 .result-practice {
     font-size: 13px;
     color: #666;
     margin-top: 8px;
     display: flex;
     align-items: center;
     gap: 6px;
 }

 .result-count {
     background: #e5e5e5;
     color: #666;
     padding: 2px 8px;
     border-radius: 10px;
     font-size: 11px;
     font-weight: 600;
 }

 .popup-distance,
 .practice-distance {
     padding: 8px 0;
     color: #149BC6;
     font-weight: 500;
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .distance-text {
     font-size: 13px;
 }

 /* Google Places Autocomplete Styling */
 .pac-container {
     font-family: inherit;
     border-radius: 8px;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     border: none;
     margin-top: 4px;
     z-index: 1001 !important;
 }

 .pac-item {
     padding: 10px 14px;
     cursor: pointer;
     border-top: 1px solid #f0f0f0;
     font-size: 14px;
 }

 .pac-item:hover {
     background-color: #f8f9fa;
 }

 .pac-item:first-child {
     border-top: none;
 }

 .pac-icon {
     margin-top: 6px;
 }

 .pac-item-query {
     font-size: 14px;
     color: #333;
 }

 .pac-matched {
     font-weight: 600;
 }

 /* Responsive adjustments */
 @media (max-width: 768px) {
     .map-search-container {
         width: calc(100% - 20px);
         max-width: none;
         left: 10px;
         right: 10px;
         transform: none;
     }

     .search-input {
         font-size: 14px;
         padding: 12px 14px;
     }

     .distance-filter-inline {
         padding: 0 8px;
     }

     .distance-filter-inline select {
         font-size: 13px;
         padding: 6px 10px;
         min-width: 70px;
     }

     .search-results-panel {
         top: 120px;
         bottom: auto;
         right: 10px;
         left: 10px;
         width: auto;
         max-height: 55vh;
     }
 }

 @media (max-width: 480px) {
     .search-box {
         flex-wrap: nowrap;
     }

     .search-input {
         font-size: 13px;
         padding: 10px 12px;
     }

     .distance-filter-inline select {
         font-size: 12px;
         padding: 5px 8px;
         min-width: 65px;
     }

     .results-count-bar {
         padding: 6px 12px;
         font-size: 12px;
     }

     .search-results-panel {
         top: 110px;
         max-height: calc(100vh - 130px);
     }
 }
