/**
 * videos.css - Estilos para la galería de videos
 */

/* Contenedor principal */


/* Barra de búsqueda y filtros */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

.search-container {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-container label {
    font-weight: 500;
    color: #333;
}

.filter-container select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.counter-container {
    font-weight: 500;
    color: #666;
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 4px;
}

/* Grid de videos */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Tarjeta de video */
.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Thumbnail del video */
.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: transform 0.3s;
}

.play-button svg {
    width: 40px;
    height: 40px;
    margin-left: 4px;
}

.video-card:hover .play-button {
    transform: scale(1.1);
}

.video-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Información de la tarjeta */
.video-card-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.4;
}

.video-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-category {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Modal de video */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgb(221, 214, 214);
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1001;
}

.close-modal:hover {
    background: white;
    transform: scale(1.1);
}

.video-modal-content {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    padding: 0;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

.video-player-container {
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    overflow: hidden;
    /*padding-top: 20px;*/
}

.video-player-container video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.video-info-container {
    padding: 0;
    text-align: center;
    background: #000;
    color: white;
}

.video-info-container h2 {
    margin: 10px 0 0 0;
    font-size: 18px;
    color: white;
}



.video-info-container p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.video-metadata {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.video-category-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.video-duration {
    color: #666;
    font-size: 14px;
}

/* Acciones del video */
.video-actions {
    margin-bottom: 20px;
}

.btn-primary {
    background: #1976d2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #1565c0;
}

.counter-expandable {
    animation: pulse 2s infinite;
}

.counter-expandable:hover {
    background: #1565c0 !important;
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(25, 118, 210, 0);
    }
}

/* Navegación entre videos */
.video-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-btn:hover:not(:disabled) {
    background: #e0e0e0;
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.video-navigation span {
    font-weight: 500;
    color: #666;
    min-width: 60px;
    text-align: center;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976d2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Sin resultados */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Mensaje de error */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-container select {
        width: 100%;
    }
    
    .video-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .video-info-container {
        padding: 5px;
    }
    
    .video-info-container h2 {
        font-size: 14px !important;
    }
    
    .video-navigation {
        gap: 15px;
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        font-size: 20px;
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .video-card-info {
        padding: 12px;
    }
    
    .video-title {
        font-size: 14px;
    }
    
    .video-description {
        font-size: 13px;
    }
}
