/* Homepage Search Form Responsive Fixes */

#doktorsitesi-hero {
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

#doktorsitesi-hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Button group styling */
.button-group {
    display: inline-flex;
    align-items: center;
    background-color: #e5e7eb;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.toggle-button {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    background-color: transparent;
    color: #4b5563;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-button.active {
    background-color: white;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toggle-button svg {
    width: 16px;
    height: 16px;
}

/* Search form inputs */
.search-input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.search-input-container {
    position: relative;
    background-color: white;
    border-radius: 6px;
}

.search-input {
    width: 100%;
    height: 56px;
    padding-left: 48px;
    padding-right: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Override nice-select styles for scrollable dropdowns */
.nice-select.search-input.dropdown-menu-scrollable {
    height: 56px !important;
    line-height: 54px !important;
}

.nice-select.search-input.dropdown-menu-scrollable .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.nice-select.search-input.dropdown-menu-scrollable .option {
    line-height: 40px !important;
    min-height: 40px !important;
}

/* Additional overrides for nice-select scrollable dropdowns */
.nice-select.search-input.dropdown-menu-scrollable.open .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Scrollable dropdown menu - showing more items */
.dropdown-menu-scrollable {
    height: auto;
    max-height: 300px;
    /* Increased height to show more items clearly */
    overflow-y: auto;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    padding-left: 48px;
    /* Add padding to accommodate the search icon */
}

.dropdown-menu-scrollable option {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.2;
}

.dropdown-menu-scrollable option:last-child {
    border-bottom: none;
}

.dropdown-menu-scrollable option:hover {
    background-color: #f5f5f5;
}

/* Custom scrollbar for dropdowns */
.dropdown-menu-scrollable::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dropdown-menu-scrollable::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.dropdown-menu-scrollable::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Hide custom dropdown styles */
.custom-dropdown-container,
.custom-dropdown,
.dropdown-selected,
.dropdown-options,
.dropdown-option,
.dropdown-arrow,
.dropdown-text {
    display: none !important;
}

.search-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    color: #9ca3af;
    width: 20px;
    height: 20px;
}

.search-button {
    height: 56px;
    background-color: #00aaff;
    color: white;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.search-button:hover {
    background-color: #0088cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Popular branches */
.popular-branches {
    margin-top: 20px;
}

.popular-branches h2 {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.branch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 800px;
    padding: 0;
    margin: 0;
}

.branch-list li {
    list-style: none;
}

.branch-link {
    color: #c9eeff;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.branch-link:hover {
    color: white;
    text-decoration: underline;
}

.show-all-button {
    color: #c9eeff;
    font-size: 14px;
    background: none;
    border: none;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.show-all-button:hover {
    color: white;
}

/* Autocomplete styles */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
    background-color: #f9fafb;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Custom dropdown styles */
.custom-dropdown-container {
    position: relative;
}

.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    width: 100%;
    height: 56px;
    padding: 0 48px 0 48px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.dropdown-selected:hover {
    border-color: #d1d5db;
}

.dropdown-selected.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.dropdown-selected.active .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dropdown-selected.active+.dropdown-options {
    max-height: 220px;
    /* Show only 5 items (5 * 44px) */
    overflow-y: auto;
}

.dropdown-options-container {
    max-height: 220px;
    /* 5 items * 44px */
    overflow-y: auto;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 16px;
}

.dropdown-option:hover {
    background-color: #f9fafb;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Custom scrollbar for dropdown options */
.dropdown-options-container::-webkit-scrollbar {
    width: 8px;
}

.dropdown-options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dropdown-options-container::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.dropdown-options-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Hide original select elements */
.search-input-container select.search-input {
    display: none;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .search-input-group {
        flex-direction: row;
        gap: 16px;
    }

    .search-input-container {
        flex: 1;
    }

    .search-button {
        width: 120px;
    }

    #doktorsitesi-hero {
        height: 550px;
    }
}

@media (max-width: 767px) {
    #doktorsitesi-hero {
        padding: 20px 0;
        min-height: auto;
    }

    .hero-content {
        padding: 20px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .button-group {
        width: 100%;
    }

    .toggle-button {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .branch-list {
        gap: 8px;
    }

    .branch-link,
    .show-all-button {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .toggle-button {
        padding: 8px 6px;
        font-size: 12px;
    }

    .search-input {
        height: 48px;
        font-size: 14px;
        padding-left: 40px;
    }

    .search-input-container select.search-input {
        background-position: right 12px center;
        background-size: 14px;
        padding-right: 32px;
    }

    .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .search-button {
        height: 48px;
        font-size: 14px;
    }
}

/* Limit Nice Select dropdown height for search dropdowns */
.search-input.nice-select .list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

.search-input.nice-select .list li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 15px;
}

.search-input.nice-select .list li:hover {
    background-color: #f0f0f0;
}

.search-input.nice-select .list li.selected {
    background-color: #e3f2fd;
    font-weight: bold;
}

/* Additional overrides for nice-select with scrollable class */
.nice-select.dropdown-menu-scrollable .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.nice-select.dropdown-menu-scrollable.open .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: scale(1) translateY(0) !important;
}

.nice-select.wide.dropdown-menu-scrollable .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Additional specific overrides for nice-select with scrollable dropdowns */
.search-input.nice-select.dropdown-menu-scrollable {
    width: 100% !important;
    height: 56px !important;
    padding-left: 48px !important;
    padding-right: 40px !important;
    border-radius: 6px !important;
    border: 1px solid #e5e7eb !important;
    background-color: white !important;
    color: #111827 !important;
    transition: all 0.2s !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    font-size: 16px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
}

/* Ensure the nice-select dropdown list has proper positioning */
.nice-select.search-input.dropdown-menu-scrollable .list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #fff !important;
    border-radius: 5px !important;
    box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11) !important;
    box-sizing: border-box !important;
    margin-top: 4px !important;
    padding: 0 !important;
    z-index: 1000 !important;
}

/* Ensure the dropdown is visible when open */
.nice-select.search-input.dropdown-menu-scrollable.open .list {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) translateY(0) !important;
}

/* Fix for browsers that don't support pointer events */
.no-csspointerevents .nice-select.search-input.dropdown-menu-scrollable.open .list {
    display: block !important;
}

/* Fallback styles for when nice-select is not available */
.search-input.dropdown-menu-scrollable:not(.nice-select) {
    width: 100%;
    height: 56px;
    padding-left: 48px;
    padding-right: 40px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom arrow for standard select elements */
.custom-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

/* Ensure scrollable functionality for standard select elements */
.search-input.dropdown-menu-scrollable:not(.nice-select) {
    width: 100%;
    height: 56px;
    padding-left: 48px;
    padding-right: 40px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    background-image: none;
    /* Remove background image since we're using custom arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom dropdown styles for fallback when nice-select is not available */
.custom-dropdown-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-dropdown-wrapper select {
    display: none;
    /* Hide the original select */
}

.custom-dropdown {
    position: relative;
    width: 100%;
    height: 56px;
    padding: 0 48px 0 48px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #111827;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.custom-dropdown:hover {
    border-color: #d1d5db;
}

.custom-dropdown.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: transform 0.2s;
    pointer-events: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.custom-dropdown.active .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.custom-dropdown.active+.dropdown-options {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 16px;
}

.dropdown-option:hover {
    background-color: #f9fafb;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Custom scrollbar for dropdown options */
.dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure proper positioning of search icon */
.search-input-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    color: #9ca3af;
    width: 20px;
    height: 20px;
}