/* 
 * Styly pro videa v galerii
 * Plugin: Stanektech Reference
 * Verze: 1.1.0
 * Datum: 2025-04-15
 */

/* Video container v galerii */
.stanektech-gallery-item.is-video .stanektech-video-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
}

/* Play tlačítko pro videa */
.stanektech-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.stanektech-video-play .dashicons {
    color: white;
    font-size: 30px;
    width: 30px;
    height: 30px;
    margin-left: 5px; /* Offset pro lepší centrování ikony Play */
}

.stanektech-gallery-item.is-video:hover .stanektech-video-play {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Náhled videa */
.stanektech-gallery-item.is-video img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.stanektech-gallery-item.is-video:hover img {
    opacity: 0.6;
}

/* Video placeholder pro použití, když není náhled */
.stanektech-video-placeholder {
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    background-color: #222;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stanektech-video-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: white;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Vlastní video lightbox */
.stanektech-video-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Indikátor videa v administraci */
.video-thumbnail .video-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px;
    border-radius: 3px;
}

.video-thumbnail .video-indicator .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Stylování video-itemu v admin tabulce */
.media-item.video-item {
    background-color: rgba(0, 115, 170, 0.04);
}

/* Video placeholder */
.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
}

.video-placeholder .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #888;
}

/* Thumbnail placeholder */
.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
}

.thumbnail-placeholder .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #888;
}

/* Ovládací prvky videa ve formuláři */
.video-type-selection {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.video-type-selection label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

.stanektech-ref-form-field {
    margin-bottom: 15px;
}

.stanektech-ref-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.stanektech-ref-form-field input[type="text"],
.stanektech-ref-form-field input[type="url"],
.stanektech-ref-form-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.stanektech-ref-form-field .description {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

/* Video modální okno */
.stanektech-ref-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.stanektech-ref-modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 70%;
    max-width: 800px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.stanektech-ref-modal-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
}

.stanektech-ref-modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.stanektech-ref-modal-close {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.stanektech-ref-modal-close:hover {
    color: #333;
}

.stanektech-ref-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.stanektech-ref-modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.stanektech-ref-modal-footer button {
    margin-left: 10px;
}

/* Lightbox video ovládání */
.stanektech-lightbox .video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.stanektech-lightbox .video-wrapper iframe,
.stanektech-lightbox .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsivní úpravy */
@media (max-width: 782px) {
    .stanektech-ref-modal-content {
        width: 90%;
        margin: 20% auto;
    }
    
    .stanektech-ref-form-field input[type="text"],
    .stanektech-ref-form-field input[type="url"],
    .stanektech-ref-form-field textarea {
        padding: 6px;
    }
    
    .video-type-selection label {
        display: block;
        margin-bottom: 8px;
    }
}