/**
 * Suno Player Click Fix
 *
 * Ensures play buttons are clickable and properly layered
 */

/* Make sure play icon is clickable */
.ms_play_icon.play-suno-song {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 100 !important;
}

/* Ensure overlay doesn't block clicks */
.ms_main_overlay {
    pointer-events: none;
}

/* But play icon inside overlay should be clickable */
.ms_main_overlay .ms_play_icon {
    pointer-events: auto;
}

/* Song overlay should not block clicks */
.ms_song_overlay {
    pointer-events: none;
}

/* Play icon in weekly/release boxes - hover animation */
.ms_weekly_box .ms_play_icon.play-suno-song,
.ms_release_box .ms_play_icon.play-suno-song {
    z-index: 100 !important;
    pointer-events: auto !important;
}

/* Hover effect - animate to center */
.ms_weekly_box:hover .ms_play_icon.play-suno-song,
.ms_weekly_box.ms_active_play .ms_play_icon.play-suno-song,
.ms_release_box:hover .ms_play_icon.play-suno-song,
.ms_release_box.ms_active_play .ms_play_icon.play-suno-song {
    top: 50% !important;
}

/* Play icon in recent slider */
.ms_rcnt_box .ms_play_icon.play-suno-song,
.ms_genres_box .ms_play_icon.play-suno-song {
    z-index: 100 !important;
    pointer-events: auto !important;
}

/* Scale animation on hover */
.ms_play_icon.play-suno-song:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    -webkit-transform: translate(-50%, -50%) scale(1.1) !important;
}

/* Remove height from jPlayer container to prevent layout issues */
#jquery_jplayer_1 {
    height: 0 !important;
}

/* Queue image styling - ensure proper display */
.play_song_name span.que_img {
    width: 50px;
    height: 50px;
    float: left;
    overflow: hidden;
}

.play_song_name span.que_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

/* Queue data - text next to image */
.play_song_name .que_data {
    width: calc(100% - 50px);
    padding-left: 15px;
    float: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Playlist queue images */
.jp-playlist span.que_img {
    width: 50px;
    height: 50px;
    float: left;
    overflow: hidden;
}

.jp-playlist span.que_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.jp-playlist .que_data {
    width: calc(100% - 50px);
    float: left;
    padding-left: 20px;
    line-height: 30px;
}

/* Debug - uncomment to see clickable area */
/*
.ms_play_icon.play-suno-song {
    background: rgba(255, 0, 0, 0.3);
}
*/

/* ========================================
   Live Search Dropdown Styles
   ======================================== */
.ms_top_search {
    position: relative;
}

.ms_live_search_dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #3bc8e7;
    border-top: none;
}

.ms_live_search_dropdown .search-results-inner {
    padding: 10px 0;
}

.ms_live_search_dropdown .search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ms_live_search_dropdown .search-result-item:hover {
    background: rgba(59, 200, 231, 0.1);
}

.ms_live_search_dropdown .search-result-img {
    width: 45px;
    height: 45px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.ms_live_search_dropdown .search-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms_live_search_dropdown .search-result-info {
    flex: 1;
    padding-left: 12px;
    min-width: 0;
}

.ms_live_search_dropdown .search-result-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.ms_live_search_dropdown .search-result-style {
    color: #888;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms_live_search_dropdown .search-result-play {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #3bc8e7 0%, #14a3c7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.ms_live_search_dropdown .search-result-play:hover {
    transform: scale(1.1);
}

.ms_live_search_dropdown .search-result-play img {
    width: 15px;
    height: 15px;
}

.ms_live_search_dropdown .search-no-results {
    padding: 20px 15px;
    text-align: center;
    color: #888;
}

.ms_live_search_dropdown .search-loading {
    padding: 20px 15px;
    text-align: center;
    color: #3bc8e7;
}

.ms_live_search_dropdown .search-view-all {
    display: block;
    text-align: center;
    padding: 12px 15px;
    background: rgba(59, 200, 231, 0.1);
    color: #3bc8e7;
    text-decoration: none;
    font-size: 14px;
    border-top: 1px solid rgba(59, 200, 231, 0.2);
    transition: background 0.3s ease;
}

.ms_live_search_dropdown .search-view-all:hover {
    background: rgba(59, 200, 231, 0.2);
    color: #fff;
}

/* Scrollbar styling for dropdown */
.ms_live_search_dropdown::-webkit-scrollbar {
    width: 6px;
}

.ms_live_search_dropdown::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.ms_live_search_dropdown::-webkit-scrollbar-thumb {
    background: #3bc8e7;
    border-radius: 3px;
}

.ms_live_search_dropdown::-webkit-scrollbar-thumb:hover {
    background: #14a3c7;
}

/* ========================================
   Load More Button Styles
   ======================================== */
.load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

#load-more-music {
    height: 45px;
    line-height: 45px;
    width: auto;
    min-width: 180px;
    padding: 0 30px;
    font-size: 16px;
    font-weight: 500;
    margin-left: 0;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #ff4865 0%, #ff6b8a 100%);
    box-shadow: 0 4px 15px rgba(255, 72, 101, 0.3);
    transition: all 0.3s ease;
}

#load-more-music:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 72, 101, 0.5);
}

#load-more-music:active {
    transform: translateY(0);
}

#load-more-music:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#load-more-music .fa-spinner {
    margin-right: 8px;
}

/* ms_weekly_wrapper load more spacing */
.ms_weekly_wrapper .load-more-wrapper {
    margin-top: 40px;
    padding-bottom: 30px;
}

/* Responsive styles for load more button */
@media (max-width: 767px) {
    #load-more-music {
        height: 40px;
        line-height: 40px;
        min-width: 150px;
        padding: 0 20px;
        font-size: 14px;
    }

    .load-more-wrapper {
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    #load-more-music {
        height: 38px;
        line-height: 38px;
        min-width: 130px;
        padding: 0 15px;
        font-size: 13px;
    }
}

/* ========================================
   Image Quality Fix - Prevent Blurry Images
   ======================================== */

/* Prevent image rendering blur */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Music thumbnails - sharp rendering */
.ms_rcnt_box_img img,
.w_tp_song_img img,
.ms_genres_box img,
.ms_release_box img,
.ms_weekly_box img,
.album_list_wrapper img,
.album_single_data img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Ensure images don't get blurry on transform/scale */
.ms_rcnt_box:hover img,
.ms_genres_box:hover img,
.ms_release_box:hover img {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    -webkit-transform: translateZ(0) scale(1);
}

/* Fix blurry images in swiper slider */
.swiper-slide img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Banner image sharp */
.ms_banner_img img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Profile image sharp */
.ms_profile_img img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Prevent subpixel rendering issues */
.ms_rcnt_box_img,
.w_tp_song_img,
.ms_genres_box,
.ms_release_box {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}
