/**
 * Reusable components for YT Playlist plugin
 * Contains card, thumbnail, info panel, and other shared components
 */

/* Video Card Component */
.yt-card {
    background: white;
    border-radius: var(--yt-playlist-radius);
    box-shadow: var(--yt-playlist-shadow);
    overflow: hidden;
    transition: var(--yt-playlist-transition);
    cursor: pointer;
}

.yt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Video Item for Grid/List */
.yt-video-item {
    background: white;
    border-radius: var(--yt-playlist-radius);
    box-shadow: var(--yt-playlist-shadow);
    overflow: hidden;
    transition: var(--yt-playlist-transition);
    cursor: pointer;
}

.yt-video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Thumbnail Component */
.yt-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.yt-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.yt-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--yt-playlist-transition);
}

.yt-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--yt-playlist-transition);
}

.yt-card:hover .yt-thumbnail,
.yt-video-item:hover .yt-video-thumbnail img {
    transform: scale(1.05);
}

/* Play Button Overlay */
.yt-play-button,
.yt-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0,0,0,0.8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--yt-playlist-transition);
    z-index: 2;
    opacity: 0.8;
    pointer-events: none; /* Let clicks pass to parent */
}

/* Alternative circular style */
.yt-play-overlay {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.yt-play-button svg,
.yt-play-overlay svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-left: 2px;
}

.yt-card:hover .yt-play-button,
.yt-video-item:hover .yt-play-overlay {
    background: var(--yt-playlist-primary-color);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Info Panel */
.yt-info,
.yt-video-info {
    padding: 1rem;
}

.yt-info h3,
.yt-video-info h3,
.yt-video-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--yt-playlist-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-info .views,
.yt-info .date {
    font-size: 0.875rem;
    color: #666;
    margin: 0.25rem 0;
}

/* Dashicons styling for metadata icons */
.yt-views-icon::before {
    content: "\f177";
    font-family: dashicons;
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.yt-likes-icon::before {
    content: "\f529";
    font-family: dashicons;
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.yt-date-icon::before {
    content: "\f145";
    font-family: dashicons;
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.yt-channel-icon::before {
    content: "\f235";
    font-family: dashicons;
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Video Metadata */
.yt-video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.yt-video-views,
.yt-video-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Duration Badge */
.yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Channel Info */
.yt-channel-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.yt-channel-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .yt-play-button,
    .yt-play-overlay {
        width: 50px;
        height: 50px;
    }
    
    .yt-play-button svg,
    .yt-play-overlay svg {
        width: 20px;
        height: 20px;
    }
    
    .yt-info,
    .yt-video-info {
        padding: 0.75rem;
    }
    
    .yt-info h3,
    .yt-video-info h3,
    .yt-video-title {
        font-size: 0.9rem;
    }
}