/* Frontend styly pro Video Feed Manager - Optimalizováno pro YouTube */

/* Container základní */
.vfm-feed {
    margin: 30px 0;
}

.vfm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: 16px;
    border: 2px solid;
    border-image: linear-gradient(135deg, #667EEA 0%, #764BA2 100%) 1;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
}

.vfm-feed-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid;
    border-image: linear-gradient(135deg, #667EEA 0%, #764BA2 100%) 1;
}

.vfm-feed-header p {
    font-size: 18px;
    color: #555;
    margin: 0;
}

/* Grid layout */
.vfm-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: 25px;
}

.vfm-video-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Celá karta je proklikávací */
}

.vfm-video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
}

/* Po hoveru změnit i play ikonu */
.vfm-video-card:hover .vfm-play-overlay {
    transform: scale(1.15);
    opacity: 1;
}

.vfm-video-thumbnail-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
    pointer-events: none; /* Aby neklikalo dvakrát */
}

.vfm-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    display: block;
}

.vfm-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
}

/* Zoom efekt na obrázek při hoveru */
.vfm-video-card:hover .vfm-video-thumbnail img {
    transform: scale(1.05);
}

/* Video placeholder pro případy bez thumbnailů */
.vfm-video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    position: absolute;
    top: 0;
    left: 0;
}

.vfm-video-placeholder.vfm-platform-youtube { 
    background: #FF0000; 
}

.vfm-video-placeholder.vfm-platform-vimeo { 
    background: #1ab7ea; 
}

.vfm-video-placeholder .vfm-platform-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    opacity: 0.9;
}

/* Play overlay - vylepšeno */
.vfm-play-overlay {
    position: absolute;
    width: 72px;
    height: 50px;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -36px;
    z-index: 2;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.vfm-play-icon {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    display: block;
    width: 100%;
    height: 100%;
}

/* Video title */
.vfm-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none; /* Aby neblokovalo klikání */
}

/* Carousel layout */
.vfm-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.vfm-carousel-container {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.vfm-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.vfm-carousel-slide {
    flex: 0 0 100%;
    padding: 0 10px;
}

.vfm-carousel-slide:not(.active) {
    display: none;
}

.vfm-carousel-slide .vfm-video-card {
    margin: 0 auto;
    max-width: 800px;
}

.vfm-carousel-nav {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vfm-carousel-nav:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.vfm-carousel-nav .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.vfm-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.vfm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.vfm-dot.active {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    transform: scale(1.3);
}

/* List layout */
.vfm-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vfm-list-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.vfm-list-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.vfm-list-thumbnail {
    flex: 0 0 240px;
    height: 135px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
}

.vfm-list-thumbnail .vfm-video-thumbnail {
    position: relative;
    padding-bottom: 0;
}

.vfm-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}

.vfm-list-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.vfm-list-description {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.vfm-platform-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: white;
    width: fit-content;
}

.vfm-platform-badge.vfm-platform-youtube { 
    background: #FF0000; 
}
.vfm-platform-badge.vfm-platform-vimeo { 
    background: #1ab7ea; 
}

/* Lightbox - optimalizováno pro YouTube */
.vfm-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.vfm-lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container pro YouTube videa */
.vfm-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#vfm-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#vfm-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: #000;
}

/* Close button */
.vfm-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 10000001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.vfm-close:hover {
    transform: rotate(90deg);
    background: rgba(255,255,255,0.2);
}

/* Animace při načtení */
.vfm-animated {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .vfm-container {
        padding: 20px;
    }
    
    .vfm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Menší play ikona na mobilech */
    .vfm-play-overlay {
        width: 60px;
        height: 42px;
        margin-top: -21px;
        margin-left: -30px;
    }
    
    .vfm-list-item {
        flex-direction: column;
    }
    
    .vfm-list-thumbnail {
        flex: 1;
        width: 100%;
        height: 200px;
    }
    
    .vfm-carousel-nav {
        width: 40px;
        height: 40px;
    }
    
    /* Lightbox na mobilech */
    .vfm-lightbox-content {
        width: 100%;
        height: 60%;
        max-height: 400px;
    }
    
    /* Větší close tlačítko na mobilech */
    .vfm-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
        top: 10px;
        right: 10px;
    }
    
    /* Lepší touch target pro mobily */
    .vfm-video-card {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .vfm-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ještě menší play ikona na malých mobilech */
    .vfm-play-overlay {
        width: 56px;
        height: 40px;
        margin-top: -20px;
        margin-left: -28px;
    }
    
    .vfm-carousel-wrapper {
        flex-direction: column;
    }
    
    .vfm-carousel-nav {
        display: none;
    }
}

/* Pro velmi malé mobily */
@media (max-width: 380px) {
    .vfm-play-overlay {
        width: 48px;
        height: 34px;
        margin-top: -17px;
        margin-left: -24px;
    }
    
    .vfm-play-icon {
        width: 48px;
        height: 34px;
    }
}