/* CSS para el Plugin de Contenedor de Videos */

/* Estilos base del contenedor */
.video-container-wrapper {
    margin: 20px 0;
    max-width: 100%;
    overflow: hidden;
}

.video-container-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
    justify-items: center;
    width: 100%;
    box-sizing: border-box;
}

.video-container-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Wrapper para videos */
.video-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

.video-wrapper blockquote {
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para descripción */
.video-description {
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #555;
    text-align: center;
    line-height: 1.4;
    font-style: italic;
}

/* Estilos para enlaces de video */
.video-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-link a {
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    padding: 15px 25px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    text-align: center;
}

.video-link a:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    text-decoration: none;
    color: white !important;
}

/* Estilos específicos para TikTok */
.tiktok-wrapper {
    background: linear-gradient(135deg, #ff0050 0%, #00f2ea 100%);
}

.tiktok-wrapper .video-link {
    background: transparent;
}

/* Estilos específicos para Instagram */
.instagram-wrapper {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.instagram-wrapper .video-link {
    background: transparent;
}

/* Modo expandible/carousel */
.video-expandable-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
}

.video-expandable-grid {
    display: grid;
    gap: 20px;
    justify-items: center;
    width: 100%;
    box-sizing: border-box;
}

.video-expandable-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Botón Ver más/menos */
.expand-toggle-btn {
    display: block;
    margin: 20px auto 0 auto;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
    transition: all 0.3s ease;
    position: relative;
    width: auto;
    max-width: 250px;
    text-align: center;
}

.expand-toggle-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.expand-toggle-btn:active {
    transform: translateY(0);
}

.expand-toggle-btn .icon {
    transition: transform 0.3s ease;
    margin-left: 8px;
    display: inline-block;
}

.expand-toggle-btn.expanded .icon {
    transform: rotate(180deg);
}

/* Estados de carga */
.video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
    height: 100%;
}

.video-loading::after {
    content: "Cargando...";
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .video-container-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .video-container-wrapper {
        margin: 15px 0;
    }
    
    .video-container-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin: 15px 0;
    }
    
    .video-container-item,
    .video-expandable-item {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .video-expandable-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .expand-toggle-btn {
        margin: 15px auto 0 auto;
        font-size: 12px;
        padding: 10px 20px;
        max-width: 200px;
    }
    
    .video-description {
        padding: 10px;
        font-size: 13px;
    }
    
    .video-link a {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .video-container-wrapper {
        margin: 10px 0;
    }
    
    .video-container-grid {
        gap: 10px !important;
        margin: 10px 0;
    }
    
    .video-expandable-container {
        padding: 10px;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .video-description {
        padding: 8px;
        font-size: 12px;
    }
    
    .expand-toggle-btn {
        margin: 10px auto 0 auto;
        font-size: 11px;
        padding: 8px 16px;
        max-width: 180px;
    }
}

/* Ajustes específicos para embeds */
.video-wrapper iframe[src*="youtube"] {
    min-height: 200px;
}

.video-wrapper iframe[src*="instagram"] {
    min-height: 400px;
}

.tiktok-wrapper blockquote {
    margin: 0 !important;
    padding: 0 !important;
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-container-item,
.video-expandable-item {
    animation: fadeIn 0.5s ease-out;
}

/* Mejoras visuales */
.video-container-item::before,
.video-expandable-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.video-container-item:hover::before,
.video-expandable-item:hover::before {
    opacity: 1;
}