/* Estilos para soporte de videos */

/* Contenedor de video */
.post-video,
.thumbnail-video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-video:hover,
.thumbnail-video:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Controles de video personalizados */
.post-video::-webkit-media-controls,
.thumbnail-video::-webkit-media-controls {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
}

.post-video::-webkit-media-controls-panel,
.thumbnail-video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Indicador de video en thumbnails */
.thread-card .thumbnail-video::before {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.thread-card:hover .thumbnail-video::before {
    opacity: 1;
}

/* Contenedor relativo para posicionamiento del indicador */
.thread-card {
    position: relative;
}

/* Estilos para videos en modo expandido */
.post-video.expanded,
.thumbnail-video.expanded {
    max-width: 100%;
    max-height: 80vh;
    cursor: zoom-out;
}

/* Responsive para videos */
@media (max-width: 768px) {
    .post-video,
    .thumbnail-video {
        max-width: 100%;
        height: auto;
    }
    
    .post-video.expanded,
    .thumbnail-video.expanded {
        max-height: 60vh;
    }
}

/* Estilos para el preview de archivos */
#file-preview,
#reply-file-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

#file-preview video,
#reply-file-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

#file-preview img,
#reply-file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* Botón para eliminar archivo */
#remove-file,
#reply-remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

#remove-file:hover,
#reply-remove-file:hover {
    background: #c82333;
}

/* Indicador de tipo de archivo */
.file-type-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 5px;
}

.file-type-indicator.video {
    background: #007bff;
    color: white;
}

.file-type-indicator.image {
    background: #28a745;
    color: white;
}

/* Animación de carga para videos */
.video-loading {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-loading::after {
    content: "Cargando video...";
    color: #6c757d;
    font-size: 14px;
}

/* Estilos para videos en modo oscuro */
.dark-theme .post-video,
.dark-theme .thumbnail-video {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.dark-theme .post-video:hover,
.dark-theme .thumbnail-video:hover {
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

.dark-theme #file-preview,
.dark-theme #reply-file-preview {
    background: #2d3748;
    border-color: #4a5568;
}

/* Mejoras de accesibilidad */
.post-video:focus,
.thumbnail-video:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Soporte para videos autoplay (solo en hover para thumbnails) */
.thread-card .thumbnail-video:hover {
    /* Los videos en thumbnails pueden tener autoplay en hover */
}

/* Estilos para videos en posts principales */
.original-post .post-video {
    margin: 10px 0;
}

/* Estilos para videos en respuestas */
.reply-card .post-video {
    margin: 8px 0;
}
