/* Safari-specific fixes for beach autocomplete */

.auto-search {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.auto-search ul {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9999;
    background: white;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Ad campaign Local Beach / Beach suggestions — keep list within the input column */
#ad_profile_beach_list,
#ad_search_beach_list {
    position: relative;
    width: 100%;
    max-width: 100%;
}

#ad_profile_beach_list ul,
#ad_search_beach_list ul {
    left: 0;
    right: auto;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

#ad_profile_beach_list .list-group-item,
#ad_search_beach_list .list-group-item {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.auto-search ul li {
    padding: 10px;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    -webkit-user-select: none;
    user-select: none;
}

.auto-search ul li:hover {
    background-color: #f0f0f0 !important;
}

/* Ensure list items are clickable in Safari */
.search1 li,
.search3 li,
.search4 li,
.search2.beachlist li,
#country_list li,
#country_list3 li,
#country_list4 li,
#beach_comp_list4 li,
#filter_beach_data li,
#ad_profile_beach_list li,
#ad_search_beach_list li,
#other_surfer_list li,
#edit_other_surfer_list li {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    pointer-events: auto !important;
}

/* Other surfer autosuggest (upload + edit post) */
#other_surfer_list,
#edit_other_surfer_list {
    position: relative;
    width: 100%;
    max-width: 100%;
    z-index: 20;
}

#other_surfer_list .other-surfer-suggest-list,
#edit_other_surfer_list .other-surfer-suggest-list {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9999;
    width: 100% !important;
    max-width: 100%;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #ddd;
    box-sizing: border-box;
    list-style: none;
    margin: 0;
    padding: 0;
}

#other_surfer_list .other-surfer-suggest-item,
#edit_other_surfer_list .other-surfer-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

#other_surfer_list .other-surfer-suggest-item:hover,
#edit_other_surfer_list .other-surfer-suggest-item:hover {
    background: #f0f0f0;
}

#other_surfer_list .other-surfer-suggest-name,
#edit_other_surfer_list .other-surfer-suggest-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}

#other_surfer_list .other-surfer-suggest-avatar,
#edit_other_surfer_list .other-surfer-suggest-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #4c8df5;
    object-fit: cover;
    flex-shrink: 0;
}

/* Filter username autosuggest (MyHub / Search) — keep width inside input column (esp. Safari) */
.filter.dropdown .dropdown-menu .col-md-8,
.filter.dropdown .dropdown-menu .white-bg {
    position: relative;
    max-width: 100%;
    min-width: 0;
}

#filter_username_data,
#filter_other_surfer_data,
#filter_beach_data {
    position: relative !important;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    z-index: 30;
    overflow: visible;
}

#filter_username_data .filter-username-suggest-list,
#filter_username_data > ul,
#filter_other_surfer_data .filter-other-surfer-suggest-list,
#filter_other_surfer_data > ul,
#filter_beach_data > ul {
    display: block !important;
    flex-direction: unset !important;
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 0;
    transform: none !important;
    z-index: 9999;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: 220px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff;
    border: 1px solid #ddd;
    box-sizing: border-box !important;
    list-style: none;
    margin: 0;
    padding: 0;
}

#filter_username_data .filter-username-suggest-item,
#filter_username_data .list-group-item,
#filter_other_surfer_data .filter-other-surfer-suggest-item,
#filter_other_surfer_data .list-group-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
}

#filter_username_data .filter-username-suggest-item:hover,
#filter_username_data .list-group-item:hover,
#filter_other_surfer_data .filter-other-surfer-suggest-item:hover,
#filter_other_surfer_data .list-group-item:hover {
    background: #f0f0f0;
}

#filter_username_data .filter-username-suggest-name,
#filter_other_surfer_data .filter-other-surfer-suggest-name {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#filter_username_data .filter-username-suggest-avatar,
#filter_username_data .list-group-item img,
#filter_other_surfer_data .filter-other-surfer-suggest-avatar,
#filter_other_surfer_data .list-group-item img {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50%;
    border: 1px solid #4c8df5;
    object-fit: cover;
    flex: 0 0 30px;
    float: none !important;
    margin-left: auto;
}

#filter_username_data li,
#filter_beach_data li,
#filter_other_surfer_data li {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* iOS / iPadOS: show the full video frame (do not crop like object-fit:cover) */
html.ios-device .jw-video-player .vjs-tech,
html.ios-device .newsFeedImgVideo .video-js .vjs-tech,
html.ios-device .jw-video-slider-player .vjs-tech,
html.ios-device #full_screen_modal .vjs-tech {
    object-fit: contain !important;
    object-position: center center !important;
}

/* iOS / iPadOS: hide Video.js center play icon + native Safari play overlay */
html.ios-device .vjs-big-play-button,
html.ios-device .video-js .vjs-big-play-button,
html.ios-device .vjs-big-play-button:before,
html.ios-device .video-js .vjs-big-play-button:before,
html.ios-device .vjs-big-play-button .vjs-icon-placeholder,
html.ios-device .vjs-big-play-button .vjs-icon-placeholder:before {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    border: none !important;
    background: none !important;
}

@supports (-webkit-touch-callout: none) {
    .vjs-big-play-button,
    .video-js .vjs-big-play-button,
    .vjs-big-play-button:before,
    .video-js .vjs-big-play-button:before,
    .vjs-big-play-button .vjs-icon-placeholder,
    .vjs-big-play-button .vjs-icon-placeholder:before {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        font-size: 0 !important;
        border: none !important;
        background: none !important;
    }

    .jw-video-player video::-webkit-media-controls-start-playback-button,
    .newsFeedImgVideo video::-webkit-media-controls-start-playback-button,
    .video-js video::-webkit-media-controls-start-playback-button,
    .vjs-tech::-webkit-media-controls-start-playback-button,
    video::-webkit-media-controls-overlay-play-button,
    video::-webkit-media-controls-start-playback-button {
        display: none !important;
        -webkit-appearance: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}
