/* Frontend Styles for DJ Cash YouTube Feed Plugin */

/* General Container Styling */
.djc-yt-feed-container {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

/* Grid Layout */
.djc-yt-feed-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* List Layout */
.djc-yt-feed-list {
    grid-template-columns: 1fr;
}

/* Individual Video Item */
.djc-yt-feed-item {
    background-color: #1a1a1a; /* Dark background matching music theme */
    color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column; /* Default for grid */
    transition: transform 0.2s ease-in-out;
}

.djc-yt-feed-item:hover {
    transform: translateY(-5px);
}

.djc-yt-feed-list .djc-yt-feed-item {
    flex-direction: row; /* Horizontal layout for list */
}

/* Thumbnail Wrapper */
.djc-yt-thumbnail-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.djc-yt-feed-list .djc-yt-thumbnail-wrap {
    flex: 0 0 200px; /* Fixed width for list thumbnail */
    padding-bottom: 0;
    height: 112.5px; /* 200 * 9 / 16 */
}

/* Video Thumbnail Image */
.djc-yt-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.djc-yt-feed-item:hover .djc-yt-thumbnail {
    transform: scale(1.05);
}

/* Play Icon Overlay */
.djc-yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    background-color: rgba(255, 0, 0, 0.8); /* YouTube red */
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0; /* Hide any default content */
    transition: background-color 0.3s ease;
    z-index: 2;
}

.djc-yt-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}

.djc-yt-feed-item:hover .djc-yt-play-icon {
    background-color: rgba(255, 0, 0, 1);
}

/* Duration Overlay */
.djc-yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    z-index: 2;
}

/* Content Area */
.djc-yt-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.djc-yt-feed-list .djc-yt-content {
    padding-left: 20px; /* More space for content in list view */
}

/* Title */
.djc-yt-title {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.djc-yt-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.djc-yt-title a:hover {
    color: #ff0000; /* YouTube red on hover */
}

/* Description (only for list layout) */
.djc-yt-description {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
    flex-grow: 1;
}

/* Meta Info */
.djc-yt-meta {
    font-size: 0.85em;
    color: #aaa;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto; /* Push meta to bottom */
}

.djc-yt-meta span {
    display: flex;
    align-items: center;
}

.djc-yt-meta span::before {
    margin-right: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .djc-yt-feed-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .djc-yt-feed-list .djc-yt-feed-item {
        flex-direction: column;
    }

    .djc-yt-feed-list .djc-yt-thumbnail-wrap {
        flex: none;
        width: 100%;
        height: 0;
        padding-bottom: 56.25%;
    }

    .djc-yt-feed-list .djc-yt-content {
        padding-left: 15px;
    }
}

@media (max-width: 480px) {
    .djc-yt-feed-container {
        grid-template-columns: 1fr; /* Single column on small mobiles */
    }

    .djc-yt-feed-item {
        border-radius: 0;
    }
}
