/* YouTube Floating Player Styles */
.youtube-floating-player {
    position: fixed;
    /* Initial position will be set by JavaScript */
    width: 400px;
    height: 269px; /* 44px header + 225px video */
    background: #000;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.youtube-floating-player:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.youtube-floating-player__header {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    padding: 8px 12px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 44px;
    box-sizing: border-box;
    margin: 0;
}

.youtube-floating-player__title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.youtube-floating-player__title svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    flex-shrink: 0;
}

.youtube-floating-player__title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.youtube-floating-player__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.youtube-floating-player__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.youtube-floating-player__body {
    padding: 0;
    margin: 0;
    background: #000;
    height: 225px;
    width: 400px;
    line-height: 0;
    font-size: 0;
    box-sizing: border-box;
}

.youtube-floating-player__iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    margin: 0;
    padding: 0;
}

/* Dark mode support */
body.dark-mode .youtube-floating-player {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

body.dark-mode .youtube-floating-player:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .youtube-floating-player {
        width: calc(100vw - 40px);
        height: auto;
        border-radius: 6px;
    }

    .youtube-floating-player__body {
        width: 100%;
        height: calc((100vw - 40px) * 0.5625); /* 16:9 aspect ratio */
    }

    .youtube-floating-player__header {
        padding: 6px 10px;
        height: 38px;
        gap: 8px;
    }

    .youtube-floating-player__title {
        font-size: 13px;
        gap: 6px;
    }

    .youtube-floating-player__close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .youtube-floating-player {
        width: calc(100vw - 20px);
        height: auto;
        border-radius: 4px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    }

    .youtube-floating-player__body {
        width: 100%;
        height: calc((100vw - 20px) * 0.5625);
    }

    .youtube-floating-player__header {
        padding: 5px 8px;
        height: 36px;
        gap: 6px;
    }

    .youtube-floating-player__title {
        font-size: 11px;
        gap: 4px;
    }

    .youtube-floating-player__title svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .youtube-floating-player__close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        flex-shrink: 0;
    }

    /* Larger tap target on mobile */
    .youtube-floating-player__close::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
    }
}

/* Dragging state */
.youtube-floating-player.ui-draggable-dragging {
    opacity: 0.9;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
