/* Casa de la Cultura - YouTube Gallery Styles */

/* Grid Layout */
.ccy-gallery.ccy-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.ccy-gallery.ccy-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ccy-gallery.ccy-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ccy-gallery.ccy-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Video Item */
.ccy-video-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ccy-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Thumbnail */
.ccy-video-thumbnail {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.ccy-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ccy-video-item:hover .ccy-video-thumbnail img {
    transform: scale(1.05);
}

/* Play Button */
.ccy-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: #ff0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    z-index: 10;
}

.ccy-play-button::before {
    content: '';
    width: 32px;
    height: 32px;
    background-image: url('../icons/play-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    filter: brightness(0) invert(1);
}

.ccy-video-item:hover .ccy-play-button {
    transform: translate(-50%, -50%) scale(1.15);
    background: #cc0000;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

/* Content */
.ccy-video-content {
    padding: 20px;
}

.ccy-video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccy-video-date {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px 0;
}

.ccy-video-description {
    font-size: 14px;
    color: #777;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List Layout */
.ccy-gallery.ccy-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px 0;
}

.ccy-gallery.ccy-list .ccy-video-item {
    display: flex;
    gap: 20px;
}

.ccy-gallery.ccy-list .ccy-video-thumbnail {
    flex: 0 0 300px;
    padding-top: 0;
    height: 180px;
}

.ccy-gallery.ccy-list .ccy-video-thumbnail img {
    position: static;
}

.ccy-gallery.ccy-list .ccy-video-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ccy-watch-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #ff0000;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    align-self: flex-start;
    margin-top: auto;
    transition: background 0.3s ease;
}

.ccy-watch-btn:hover {
    background: #cc0000;
}

/* Carousel Layout */
.ccy-carousel {
    margin: 40px 0;
}

.ccy-carousel .swiper-slide {
    text-align: center;
}

.ccy-carousel img {
    width: 100%;
    border-radius: 8px;
}

.ccy-carousel h3 {
    margin-top: 15px;
    font-size: 16px;
}

/* Error Messages */
.ccy-error,
.ccy-no-videos {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    text-align: center;
    color: #856404;
}

.ccy-error-admin {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .ccy-gallery.ccy-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .ccy-gallery.ccy-list .ccy-video-item {
        flex-direction: column;
    }
    
    .ccy-gallery.ccy-list .ccy-video-thumbnail {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* Loading Animation */
.ccy-loading {
    text-align: center;
    padding: 60px 20px;
}

.ccy-loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.ccy-video-link:focus {
    outline: 3px solid #ff0000;
    outline-offset: 2px;
}

.ccy-video-link:focus .ccy-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

/* ========================================
   PLAYLISTS STYLES
   ======================================== */

/* Playlist Item */
.ccy-playlist-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.ccy-playlist-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.ccy-playlist-item .ccy-video-thumbnail {
    position: relative;
}

/* Playlist Badge (Grid/Card view) */
.ccy-playlist-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.ccy-playlist-badge svg {
    width: 16px;
    height: 16px;
}

/* Playlist Badge (List view) */
.ccy-playlist-badge-list {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
}

/* Playlist Badge (Carousel view) */
.ccy-playlist-badge-carousel {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Playlist Link */
.ccy-playlist-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.ccy-playlist-link:hover .ccy-playlist-badge {
    background: rgba(255, 0, 0, 0.95);
}

/* Carousel Thumbnail Container */
.ccy-carousel-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Playlist Specific Grid */
.ccy-playlists.ccy-grid .ccy-playlist-item {
    border: 2px solid transparent;
}

.ccy-playlists.ccy-grid .ccy-playlist-item:hover {
    border-color: #ff0000;
}

/* Responsive adjustments for playlists */
@media (max-width: 768px) {
    .ccy-playlist-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .ccy-playlist-badge svg {
        width: 14px;
        height: 14px;
    }
}