/* ============================================================================
   SEARCH DOCTOR PAGE - SEARCH CARD STYLES
   Separate styles from home page search card
   ============================================================================ */

/* ============================================================================
   PAGE-SPECIFIC STYLES
   ============================================================================ */

/* Body Font */
body {
    font-family: 'Geologica', system-ui, sans-serif !important;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* Doctor card clickable */
.doctor-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Prevent card click on interactive elements */
.doctor-card a,
.doctor-card button,
.doctor-card input[type="radio"],
.doctor-card label {
    position: relative;
    z-index: 10;
}

/* Doctor Results List Container */
.sd-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================================================
   SD (Search Doctor) PREFIX - To avoid conflicts with home page
   ============================================================================ */

/* Main Search Card Container */
.sd-search-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 8px 0;
    margin: 0 auto;
    border: none;
    transition: all 0.25s ease;
}

.sd-search-card:focus-within {
    border-color: var(--primary-400);
}

/* Search Inputs Container */
.sd-search-inputs-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Search Input Groups */
.sd-search-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 14px;
    background: transparent;
    border-radius: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
    border: 1px solid #e5e7eb;
}

.sd-search-group:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.sd-search-group:focus-within {
    border-color: var(--primary-500);
}

/* Search Icon */
.sd-search-icon {
    color: #64748b;
    font-size: 1.1rem;
    pointer-events: none;
}

/* Search Text Field */
.sd-search-field {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
}

.sd-search-field::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* ============================================================================
   SD CUSTOM DROPDOWN
   ============================================================================ */

.sd-dropdown-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.sd-custom-dropdown {
    width: 100%;
    position: relative;
}

.sd-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    cursor: pointer;
    user-select: none;
    border-radius: 14px;
    padding: 0 14px;
    background: transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
    border: 1px solid #e5e7eb;
}

.sd-dropdown-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.sd-custom-dropdown.open .sd-dropdown-trigger,
.sd-dropdown-trigger:focus {
    border-color: var(--primary-500);
    outline: none;
}

.sd-dropdown-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 1;
}

.sd-dropdown-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    order: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-dropdown-arrow {
    font-size: 14px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    order: 3;
}

.sd-custom-dropdown.open .sd-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.sd-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 999;
}

.sd-custom-dropdown.open .sd-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Item */
.sd-dropdown-item {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.sd-dropdown-item:hover {
    background: #f1f5f9;
}

/* Dropdown Icon */
.sd-dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sd-dropdown-icon.indigo {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: var(--white);
}

.sd-dropdown-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
}

.sd-dropdown-icon.green {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: var(--white);
}

.sd-dropdown-icon.orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: var(--white);
}

.sd-dropdown-icon.purple {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: var(--white);
}

.sd-dropdown-icon.medical {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: var(--white);
}

/* Dropdown Text */
.sd-dropdown-item-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
}

/* Scrollbar */
.sd-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.sd-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 10px;
}

/* ============================================================================
   SD SEARCH BUTTON
   ============================================================================ */

.sd-btn-search {
    height: 52px;
    width: 52px;
    border-radius: 14px;
    background: var(--primary-brand);
    color: #ffffff;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sd-btn-search:hover {
    background: var(--primary-brand-hover);
    color: #ffffff;
}

/* ============================================================================
   SD ERROR MESSAGES & CLEAR BUTTON
   ============================================================================ */

.sd-error-msg {
    position: absolute;
    bottom: -1.4rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #ef4444;
}

.sd-cross-btn {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.sd-cross-btn:hover {
    color: #475569;
}

/* ============================================================================
   SD RESPONSIVE - MOBILE (768px and below)
   ============================================================================ */

@media (max-width: 768px) {
    .sd-search-card {
        border-radius: 1.5rem;
        padding: 0.75rem;
    }

    .sd-search-inputs-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Dropdown Wrapper - Mobile: Full width */
    .sd-dropdown-wrapper {
        width: 100%;
    }

    /* Custom Dropdown - Mobile: Full width */
    .sd-custom-dropdown {
        width: 100%;
    }

    /* Search Group - Mobile: Remove border, let dropdown trigger handle it */
    .sd-search-group {
        width: 100%;
        background: transparent;
        padding: 0;
        border: none;
        height: auto;
    }

    /* Dropdown Trigger - Mobile: Full styling with single border */
    .sd-dropdown-trigger {
        width: 100%;
        height: 48px;
        padding: 0 12px;
        border: 1px solid #e5e7eb;
        border-radius: 9999px;
        background: transparent;
    }

    .sd-dropdown-trigger:hover {
        border-color: #cbd5e1;
        background: #f8fafc;
    }

    .sd-custom-dropdown.open .sd-dropdown-trigger {
        border-color: var(--primary-500);
    }

    /* Autocomplete Input Group - Mobile styling */
    .sd-search-group:not(.sd-dropdown-wrapper) {
        border: 1px solid #e5e7eb;
        border-radius: 9999px;
        min-height: 48px;
        padding: 12px;
        display: flex;
        align-items: center;
    }

    .sd-search-group:not(.sd-dropdown-wrapper):hover {
        border-color: #cbd5e1;
        background: #f8fafc;
    }

    .sd-search-group:not(.sd-dropdown-wrapper):focus-within {
        border-color: var(--primary-500);
    }

    /* Dropdown Icon */
    .sd-dropdown-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Dropdown Text */
    .sd-dropdown-item-text {
        font-size: 0.875rem;
    }

    /* Dropdown Menu */
    .sd-dropdown-menu {
        max-height: 240px;
    }

    /* Search Button */
    .sd-btn-search {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 9999px;
        padding: 0.875rem 1.5rem;
        justify-content: center;
        font-size: 1rem;
    }

    .sd-btn-search i {
        margin-right: 0.5rem;
    }

    .sd-btn-search::after {
        content: "Find";
        margin-left: 0.5rem;
    }

    /* Search Field */
    .sd-search-field {
        border-radius: 9999px;
        padding: 0;
        line-height: 1.5;
    }

    /* Hide Map Sidebar on Mobile */
    #sidebar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .sd-search-card {
        padding: 0.5rem;
    }

    .sd-dropdown-trigger {
        height: 44px;
    }

    .sd-search-group:not(.sd-dropdown-wrapper) {
        height: 44px;
    }

    .sd-btn-search {
        height: 44px;
    }
}

/* Show Map Sidebar on Large Screens (1024px and above) */
@media (min-width: 1024px) {
    #sidebar {
        display: block !important;
    }
}

/* Hide Map Sidebar on Mobile */
@media (max-width: 1023px) {
    #sidebar {
        display: none !important;
    }
}

/* ============================================================================
   MAP MODAL STYLES (Bootstrap Modal)
   ============================================================================ */

#mapModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

#mapModal .modal-body {
    padding: 0;
}

/* Map container inside modal */
#map_listing_mobile {
    width: 100%;
    height: 100%;
    min-height: 350px;
}

/* Responsive modal size */
@media (max-width: 576px) {
    #mapModal .modal-dialog {
        margin: 1rem;
    }

    #mapModal .modal-content {
        border-radius: 12px;
    }
}

/* ============================================================================
   MAP INFO BOX STYLES
   ============================================================================ */

/* Override default infoBox width */
.infoBox {
    width: auto !important;
    min-width: 280px !important;
    max-width: 320px !important;
}

/* Info box content styling */
.marker_info {
    min-width: 160px !important;
    max-width: 300px !important;
    padding: 12px !important;
}

.marker_info figure {
    margin-bottom: 10px;
}

.marker_info figure img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d0d1da;
}

.marker_info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.marker_info h3 a {
    color: inherit;
    text-decoration: none;
}

.marker_info h3 a:hover {
    color: var(--primary-600, #0891b2);
}

.marker_info>span {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-bottom: 10px;
}

/* Action buttons container - Stack vertically */
.marker_info .flex {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Directions button */
.marker_info .flex form {
    width: 100%;
}

.marker_info .flex form button {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--primary-500, #06b6d4);
    color: white;
    transition: background 0.2s;
}

.marker_info .flex form button:hover {
    background: var(--primary-600, #0891b2);
}

/* Phone button */
.marker_info .flex>a {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    transition: background 0.2s;
}

.marker_info .flex>a:hover {
    background: #e2e8f0;
}

/* Close button styling - INSIDE the card */
.marker_info {
    position: relative;
}

.infobox-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    font-size: 18px;
    line-height: 24px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.infobox-close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Hide the external InfoBox close button */
.infoBox>img[src*="close"] {
    display: none !important;
}