.ytpw-container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    padding: 25px !important;

    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ytpw-video-list {
    flex: 1;
    max-height: 600px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-list-custom {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ytpw-video-item {
    display: flex;
    align-items: flex-start;
    /* Changed to flex-start for better text alignment */
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
    /* Ensure consistent height even with wrapped text */
}

.ytpw-video-item:hover {
    background: #f8f8f8;
}

.ytpw-video-item.active {
    background: #f0f7ff;
    border-left: 3px solid #1a73e8;
}

.video-item-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f1f1;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    margin-top: 3px;
    /* Align better with first line of text */
}

.ytpw-video-item.active .video-item-number {
    background: #BF1E2E;
    color: white;
}

.video-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    /* Center content vertically */
    height: 100%;
}

.video-item-title {
    font-size: 15px;
    line-height: 1.4;
    /* Removed white-space and text-overflow properties */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    /* Break long words if needed */
}

.ytpw-video-player {
    flex: 2;
    min-width: 0;
}

.ytpw-video-player iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Scrollbar styling */
.video-list-custom::-webkit-scrollbar {
    width: 6px;
}

.video-list-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.video-list-custom::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.video-list-custom::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive design */
@media (max-width: 768px) {
    .ytpw-container {
        flex-direction: column;
        padding: 25px;

    }

    .ytpw-video-player iframe {
        height: 250px;
    }

    .ytpw-video-list {
        max-height: 300px;
    }

    .video-item-title {
        -webkit-line-clamp: 3;
        /* Allow more lines on mobile */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ytpw-video-list {
        background: #2d2d2d;
    }

    .ytpw-video-item {
        border-bottom-color: #444;
    }

    .ytpw-video-item:hover {
        background: #333;
    }

    .ytpw-video-item.active {
        background: #1a344d;
        border-left-color: #4285f4;
    }

    .video-item-number {
        background: #444;
        color: #ddd;
    }

    .ytpw-video-item.active .video-item-number {
        background: #4285f4;
        color: white;
    }

    .video-item-title {
        color: #eee;
    }

    .video-list-custom::-webkit-scrollbar-track {
        background: #333;
    }

    .video-list-custom::-webkit-scrollbar-thumb {
        background: #555;
    }
}

.ytpw-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #BF1E2E 0%, #9c333e 50%, #BF1E2E 100%);
    background-size: 200% 100%;
    animation: gradientBG 8s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.ytpw-video-player {
    flex: 2;
    min-width: 300px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.ytpw-video-player:hover {
    transform: translateY(-5px);
}

.ytpw-video-player iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ytpw-video-player iframe:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.ytpw-video-list {
    flex: 1;
    min-width: 300px;
    max-height: 500px;
    overflow: hidden;
    background: #ffffff;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.ytpw-playlist-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
    padding: 25px 25px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ytpw-playlist-icon {
    width: 24px;
    height: 24px;
    fill: #667eea;
}

.ytpw-video-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: calc(500px - 10px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #BF1E2E #f0f2f5;
}

.ytpw-video-list ul::-webkit-scrollbar {
    width: 8px;
}

.ytpw-video-list ul::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 4px;
}

.ytpw-video-list ul::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.ytpw-video-list ul::-webkit-scrollbar-thumb:hover {
    background: #BF1E2E;
}

.ytpw-video-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    cursor: pointer;
    margin: 0;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    gap: 15px;
}

.ytpw-video-item:last-child {
    border-bottom: none;
}

.video-list-custom {
    padding-right: 0px !important;
    margin-right: 0px !important;
}

.ytpw-video-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    transition: width 0.3s ease;
}

.ytpw-video-item:hover {
    background: rgba(102, 126, 234, 0.03);
}

.ytpw-video-item:hover::after {
    width: 5px;
}

.ytpw-video-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.ytpw-video-item.active::after {
    width: 5px;
    background: linear-gradient(90deg, #BF1E2E 0%, #764ba2 100%);
}

.ytpw-video-thumbnail-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.ytpw-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ytpw-video-item:hover .ytpw-video-thumbnail {
    transform: scale(1.05);
}

.ytpw-video-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
}

.ytpw-video-content {
    flex: 1;
    min-width: 0;
}

.ytpw-video-title {
    font-size: 0.95em;
    color: #2d3748;
    line-height: 1.4;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    transition: color 0.2s ease;
}

.ytpw-video-item.active .ytpw-video-title {
    color: #1a1a1a;
    font-weight: 600;
}

.ytpw-video-meta {
    display: flex;
    align-items: center;
    font-size: 0.8em;
    color: #718096;
    gap: 8px;
}

.ytpw-video-channel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading animation */
.ytpw-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    color: #BF1E2E;
    font-size: 1.2em;
    flex-direction: column;
}

.ytpw-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #BF1E2E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ytpw-container {
        padding: 25px;
    }

    .ytpw-video-player iframe {
        height: 400px;
    }

    .ytpw-video-list {
        max-height: 400px;
    }

    .ytpw-video-list ul {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .ytpw-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .ytpw-video-player {
        order: 1;
        min-width: 100%;
    }

    .ytpw-video-list {
        order: 2;
        min-width: 100%;
        max-height: 350px;
    }

    .ytpw-video-player iframe {
        height: 300px;
    }

    .ytpw-playlist-title {
        font-size: 1.3em;
        padding: 20px 20px 15px;
    }

    .ytpw-video-item {
        display: flex;
        align-items: flex-start;
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        transition: background-color 0.2s ease;
        /* Only transition background */
        min-height: 60px;
        -webkit-tap-highlight-color: transparent;
        /* Remove tap highlight */
        touch-action: manipulation;
        /* Improve touch responsiveness */
    }

    /* Add this new class for touch devices */
    @media (hover: none) and (pointer: coarse) {
        .ytpw-video-item {
            padding: 15px;
            /* Slightly larger touch target */
        }

        .video-list-custom {
            -webkit-overflow-scrolling: touch;
            /* Smooth scrolling on iOS */
        }
    }

    .ytpw-video-thumbnail-wrapper {
        width: 70px;
        height: 52px;
    }

    .ytpw-video-title {
        font-size: 0.9em;
    }

    .ytpw-video-list ul {
        max-height: calc(350px);
    }
}

@media (max-width: 480px) {
    .ytpw-container {
        padding: 15px;
        border-radius: 12px;
        padding: 25px;

    }

    .ytpw-container::before {
        height: 4px;
    }

    .ytpw-video-player iframe {
        height: 220px;
        border-radius: 12px;
    }

    .ytpw-playlist-title {
        font-size: 1.2em;
        padding: 15px 15px 12px;
    }

    .ytpw-video-item {
        padding: 10px 15px;
        gap: 10px;
    }

    .ytpw-video-thumbnail-wrapper {
        width: 60px;
        height: 45px;
    }

    .ytpw-video-title {
        font-size: 0.85em;
    }

    .ytpw-video-list {
        max-height: 300px;
        border-radius: 12px;
    }

    .ytpw-video-list ul {
        max-height: calc(300px);
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .ytpw-container {
        background: linear-gradient(145deg, #1a1a1a 0%, #111111 100%);
        border-color: rgba(255, 255, 255, 0.05);

    }

    .ytpw-video-list {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .ytpw-playlist-title {
        color: #f8fafc;
        background-color: #1e293b;
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .ytpw-video-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .ytpw-video-item:hover {
        background: rgba(102, 126, 234, 0.05);
    }

    .ytpw-video-title {
        color: #f8fafc;
    }

    .ytpw-video-meta {
        color: #94a3b8;
    }

    .ytpw-video-duration {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }

    .ytpw-video-list ul::-webkit-scrollbar-track {
        background: #1e293b;
    }

    .ytpw-video-list ul::-webkit-scrollbar-thumb {
        background: #475569;
    }

    .ytpw-video-list ul::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

    .ytpw-loading {
        color: #818cf8;
    }

    .ytpw-loading-spinner {
        border-color: rgba(129, 140, 248, 0.2);
        border-top-color: #818cf8;
    }
}