/* Estilos para el Gestor de Videos */

/* Modal principal */
.video-modal {
    z-index: 2500;
}

.video-content {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
}

/* Header del modal */
.video-header {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.video-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.close-video {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-video:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Tabs de navegación */
.video-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.video-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.video-tab.active {
    color: #ff8c00;
    border-bottom: 3px solid #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.video-tab:hover:not(.active) {
    background: #f8f9fa;
    color: #333;
}

/* Contenedor principal */
.video-container {
    flex: 1;
    padding: 2rem;
    background: white;
    border-radius: 0 0 15px 15px;
}

/* Sección de subir video */
.upload-video-section {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Área de subida de video */
.video-upload-group {
    margin-bottom: 2rem;
}

.video-upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.video-upload-area:hover,
.video-upload-area.drag-over {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.upload-placeholder i {
    font-size: 4rem;
    color: #ff8c00;
    margin-bottom: 1rem;
}

.upload-placeholder p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.upload-placeholder small {
    color: #666;
    font-size: 0.9rem;
}

/* Preview de video */
.video-preview {
    margin-top: 1rem;
}

.video-preview-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.video-file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.video-file-info p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.remove-video {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-video:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Acciones del formulario */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel,
.btn-submit {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-submit {
    background: #ff8c00;
    color: white;
}

.btn-submit:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* Gestión de videos */
.videos-management {
    width: 100%;
}

.videos-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: flex-end;
}

.btn-danger,
.btn-secondary,
.btn-primary {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #ff8c00;
    color: white;
}

.btn-primary:hover {
    background: #e67e22;
}

/* Grid de videos */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Thumbnail del video */
.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-item:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    background: rgba(255, 140, 0, 0.9);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: #ff8c00;
    transform: scale(1.1);
}

/* Información del video */
.video-info {
    padding: 1rem;
}

.video-info h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    line-height: 1.3;
}

.video-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.video-category,
.video-size,
.video-date {
    background: #f8f9fa;
    color: #666;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.video-category {
    background: rgba(255, 140, 0, 0.1);
    color: #ff8c00;
    font-weight: 500;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* Acciones del video */
.video-actions {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.btn-edit,
.btn-share,
.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-edit {
    color: #007bff;
}

.btn-edit:hover {
    background: rgba(0, 123, 255, 0.1);
}

.btn-share {
    color: #28a745;
}

.btn-share:hover {
    background: rgba(40, 167, 69, 0.1);
}

.btn-delete {
    color: #dc3545;
}

.btn-delete:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Videos vacíos */
.empty-videos {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.empty-videos i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.empty-videos h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.3rem;
}

.empty-videos p {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
}

/* Modal de reproductor */
.video-player-modal {
    z-index: 3000;
}

.video-player-content {
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.close-player {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.close-player:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.video-player-container {
    background: #000;
}

.video-player-info {
    background: white;
    padding: 1.5rem;
}

.video-player-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.video-player-info p {
    margin: 0 0 1rem 0;
    color: #666;
    line-height: 1.5;
}

.video-player-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .video-content {
        width: 98%;
        margin: 1vh auto;
    }

    .video-container {
        padding: 1rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .video-tabs {
        flex-direction: column;
    }

    .video-tab {
        padding: 0.8rem 1rem;
        border-bottom: 1px solid #e0e0e0;
    }

    .video-tab.active {
        border-bottom: 1px solid #ff8c00;
        border-left: 3px solid #ff8c00;
    }

    .videos-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column;
    }

    .video-upload-area {
        padding: 2rem 1rem;
    }

    .upload-placeholder i {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .video-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .video-header {
        padding: 1rem;
        border-radius: 0;
    }

    .video-container {
        padding: 0.5rem;
    }

    .video-item {
        margin-bottom: 1rem;
    }

    .video-actions {
        justify-content: center;
        gap: 1rem;
    }
}