/* Parent bubble - clean */
.bubble:has(.boomvideo[value="youtube"]),
.bubble:has(.youtube-enhanced),
.bubble.youtube-bubble {
    max-width: none !important;
    width: auto !important;
    display: inline-block !important;
    white-space: normal !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* Fix original boomvideo element */
.boomvideo[value="youtube"],
.boomcvideo[value="youtube"] {
    width: 240px !important;
    height: 135px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    display: block !important;
}

/* Parent containers */
.video_container:has(.boomvideo[value="youtube"]),
.chat_video_container:has(.boomvideo[value="youtube"]),
.video_container.youtube-container,
.chat_video_container.youtube-container {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    display: inline-block !important;
    position: relative !important;
}

/* Main YouTube container - MODERN CARD */
.youtube-enhanced {
    position: relative !important;
    display: inline-block !important;
    width: 240px !important;
    margin: 5px 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Video Wrapper - Main card with shadow */
.youtube-enhanced .video-wrapper {
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    width: 240px !important;
    height: 135px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.youtube-enhanced .video-wrapper:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
}

/* Video Thumbnail */
.youtube-enhanced .video-thumbnail {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    line-height: 0 !important;
    display: block !important;
}

.youtube-enhanced .video-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important;
}

/* Play Button Overlay - Modern */
.youtube-enhanced .play-overlay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(255, 0, 0, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4) !important;
}

.youtube-enhanced .play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    background: rgba(255, 0, 0, 1) !important;
}

.youtube-enhanced .play-overlay i {
    color: #fff !important;
    font-size: 18px !important;
    margin-left: 3px !important;
}

/* Inline Player */
.youtube-enhanced .inline-player {
    position: relative !important;
    width: 100% !important;
    padding-top: 56.25% !important;
    display: none !important;
    background: #000 !important;
}

.youtube-enhanced .inline-player iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.youtube-enhanced.playing .video-thumbnail {
    display: none !important;
}

.youtube-enhanced.playing .inline-player {
    display: block !important;
}

/* Player Controls - Top right */
.youtube-enhanced .player-controls {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    display: flex !important;
    gap: 4px !important;
    z-index: 10 !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.youtube-enhanced:hover .player-controls,
.youtube-enhanced.playing .player-controls {
    opacity: 1 !important;
}

.youtube-enhanced .control-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.youtube-enhanced .control-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1) !important;
}

.youtube-enhanced .control-btn i {
    color: #fff !important;
    font-size: 12px !important;
}

/* Minimize button - shown when playing */
.youtube-enhanced .minimize-btn {
    position: absolute !important;
    bottom: 6px !important;
    left: 6px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: none !important;
    cursor: pointer !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.youtube-enhanced.playing .minimize-btn {
    display: flex !important;
}

.youtube-enhanced .minimize-btn i {
    color: #fff !important;
    font-size: 12px !important;
}

/* ========================================
   FLOATING MINI PLAYER
   ======================================== */

.youtube-floating-player {
    position: fixed !important;
    bottom: 80px !important;
    right: 20px !important;
    width: 280px !important;
    z-index: 9999 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    animation: floatIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    cursor: move !important;
    background: #000 !important;
    will-change: left, top !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Drag overlay - iframe Ã¼zerinde sÃ¼rÃ¼kleme sorununu Ã§Ã¶zer */
.yt-drag-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 50 !important;
    display: none;
    cursor: move !important;
    background: transparent !important;
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(50px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.youtube-floating-player .floating-video {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-top: 56.25% !important;
    overflow: hidden !important;
}

.youtube-floating-player .floating-video iframe,
.youtube-floating-player .floating-video > div {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    max-height: 100% !important;
}

.youtube-floating-player .floating-controls {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 8px !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.youtube-floating-player:hover .floating-controls {
    opacity: 1 !important;
}

.youtube-floating-player .floating-title {
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    margin-right: 8px !important;
}

.youtube-floating-player .floating-btns {
    display: flex !important;
    gap: 4px !important;
}

.youtube-floating-player .float-btn {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.youtube-floating-player .float-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.youtube-floating-player .float-btn i {
    color: #fff !important;
    font-size: 11px !important;
}

.youtube-floating-player .playing-indicator {
    position: absolute !important;
    bottom: 8px !important;
    left: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(255, 0, 0, 0.9) !important;
    padding: 3px 8px !important;
    border-radius: 15px !important;
}

.youtube-floating-player .playing-indicator .pulse-dot {
    width: 6px !important;
    height: 6px !important;
    background: #fff !important;
    border-radius: 50% !important;
    animation: pulseDot 1s ease-in-out infinite !important;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.youtube-floating-player .playing-indicator span {
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 600 !important;
}

/* ========================================
   REACTION SYSTEM - OVERLAY ON VIDEO
   ======================================== */

/* Reactions bar - bottom of video */
.youtube-reactions-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(transparent, rgba(0,0,0,0.7)) !important;
    padding: 20px 10px 8px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 0 0 12px 12px !important;
}

/* Reaction trigger button - on video */
.youtube-reaction-trigger {
    position: relative !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.95) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
}

.youtube-reaction-trigger:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.youtube-reaction-trigger:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
}

/* Reaction popup - horizontal above button */
.reaction-popup {
    position: absolute !important;
    bottom: 40px !important;
    left: 0 !important;
    background: #fff !important;
    border-radius: 20px !important;
    padding: 4px 6px !important;
    display: none !important;
    flex-direction: row !important;
    gap: 2px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    z-index: 100 !important;
    animation: popupFadeIn 0.2s ease !important;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reaction-popup.show {
    display: flex !important;
}

.reaction-popup .reaction-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    transition: all 0.2s ease !important;
}

.reaction-popup .reaction-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    transform: scale(1.2) !important;
}

.reaction-popup .reaction-btn.reacting {
    animation: reactionPop 0.3s ease !important;
}

@keyframes reactionPop {
    50% { transform: scale(1.4); }
}

/* Reaction avatars - horizontal display */
.youtube-reactions-display {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    flex: 1 !important;
}

.reaction-avatars {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

.reaction-avatar-wrap {
    position: relative !important;
    margin-left: -6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.reaction-avatar-wrap:first-child {
    margin-left: 0 !important;
}

.reaction-avatar-wrap:hover {
    transform: scale(1.15) translateY(-2px) !important;
    z-index: 10 !important;
}

.reaction-avatar {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255,255,255,0.9) !important;
    object-fit: cover !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.reaction-avatar-emoji {
    position: absolute !important;
    bottom: -2px !important;
    right: -4px !important;
    font-size: 8px !important;
    background: #fff !important;
    border-radius: 50% !important;
    width: 12px !important;
    height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

.reaction-tooltip {
    position: absolute !important;
    bottom: calc(100% + 5px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.85) !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    color: #fff !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.2s ease !important;
    z-index: 100 !important;
}

.reaction-avatar-wrap:hover .reaction-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

/* More count button */
.reaction-count {
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    background: rgba(255,255,255,0.2) !important;
    border-radius: 10px !important;
    padding: 2px 8px !important;
    margin-left: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.reaction-count:hover {
    background: rgba(255,255,255,0.3) !important;
}

.reaction-count:empty {
    display: none !important;
}

.no-reactions {
    display: none !important;
}

/* All reactions popup */
.all-reactions-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #fff !important;
    border-radius: 12px !important;
    padding: 15px !important;
    min-width: 200px !important;
    max-width: 280px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
    z-index: 10000 !important;
    animation: popupFadeIn 0.2s ease !important;
}

.all-reactions-popup .popup-header {
    font-weight: bold !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #eee !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.all-reactions-popup .popup-close {
    cursor: pointer !important;
    font-size: 18px !important;
    color: #999 !important;
}

.all-reactions-popup .popup-close:hover {
    color: #333 !important;
}

.all-reactions-popup .reaction-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f5f5f5 !important;
}

.all-reactions-popup .reaction-item:last-child {
    border-bottom: none !important;
}

.all-reactions-popup .reaction-item img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
}

.all-reactions-popup .reaction-item .name {
    flex: 1 !important;
    font-size: 13px !important;
}

.all-reactions-popup .reaction-item .emoji {
    font-size: 16px !important;
}

.reactions-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9999 !important;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media screen and (max-width: 768px) {
    .youtube-enhanced {
        width: 200px !important;
    }
    
    .youtube-enhanced .video-wrapper {
        width: 200px !important;
        height: 112px !important;
    }
    
    .youtube-enhanced .play-overlay {
        width: 40px !important;
        height: 40px !important;
    }
    
    .youtube-enhanced .play-overlay i {
        font-size: 14px !important;
    }
    
    .youtube-reaction-trigger {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    
    .reaction-popup .reaction-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
    
    .youtube-floating-player {
        width: 180px !important;
        bottom: 70px !important;
        right: 10px !important;
    }
    
    .reaction-avatar {
        width: 18px !important;
        height: 18px !important;
    }
    
    .reaction-avatar-emoji {
        width: 10px !important;
        height: 10px !important;
        font-size: 6px !important;
    }
    
    .youtube-reactions-bar {
        padding: 15px 8px 6px 8px !important;
    }
}

/* Original search styles */
.you_result { width: 50%; float: left; height: 150px; }
.you_tumb { width: 100%; }
.you_text { max-height: 32px; font-size: 12px; overflow: hidden; }
.youtube_results { min-height: 320px; max-height: 320px; overflow: hidden; overflow-y: auto; }

@media screen and (max-width: 330px) {
    .you_result { height: 140px; }
    .you_text { max-height: 45px; }
}

/* ========================================
   TOUCH DEVICE FIX
   Mobil/dokunmatik cihazlarda kalıcı bir
   :hover durumu olmadığı için player kontrol
   ikonu hiç görünmüyordu. Bu bloklarla
   dokunmatik cihazlarda ve küçük ekranlarda
   ikonlar her zaman görünür hale getirilir.
   ======================================== */
@media (hover: none), screen and (max-width: 768px) {
    .youtube-enhanced .player-controls {
        opacity: 1 !important;
    }
}
