/* ===================================
   Gestión de Ejercicios - Estilos
   =================================== */

.gestion-ejercicios-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding-bottom: 100px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

.header-content {
    flex: 1;
    text-align: center;
}

.header-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin: 4px 0 0;
}

.header-spacer {
    width: 44px;
}

.btn-crear {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4a7ba7 0%, #6b9dc4 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-crear:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 123, 167, 0.4);
}

.btn-crear svg {
    width: 18px;
    height: 18px;
}

/* Content */
.content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Filtros */
.filtros-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0 16px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    padding: 12px 0;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.filtro-grupo {
    min-width: 180px;
}

.filtro-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.filtro-select option {
    background: #1a1a2e;
    color: white;
}

.btn-buscar {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a7ba7 0%, #6b9dc4 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-buscar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 123, 167, 0.4);
}

/* Stats Bar */
.stats-bar {
    margin-bottom: 16px;
}

.total-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-bottom: 20px;
}

.empty-icon svg {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a7ba7 0%, #6b9dc4 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 123, 167, 0.4);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Table */
.ejercicios-table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ejercicios-table {
    width: 100%;
    border-collapse: collapse;
}

.ejercicios-table th,
.ejercicios-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ejercicios-table th {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ejercicios-table tbody tr {
    transition: background 0.2s ease;
}

.ejercicios-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ejercicios-table tbody tr:last-child td {
    border-bottom: none;
}

/* Media Indicators */
.media-indicators {
    display: flex;
    gap: 6px;
}

.media-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.media-badge svg {
    width: 16px;
    height: 16px;
}

.media-badge.image {
    background: rgba(74, 123, 167, 0.2);
    color: #6b9dc4;
}

.media-badge.video {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.media-badge.none {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
}

/* Nombre */
.nombre-ejercicio {
    color: white;
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-grupo {
    background: rgba(74, 123, 167, 0.2);
    color: #6b9dc4;
}

.badge-dificultad {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.badge-equipamiento {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* Actions */
.acciones-btns {
    display: flex;
    gap: 8px;
}

.btn-accion {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-accion svg {
    width: 18px;
    height: 18px;
}

.btn-editar {
    background: rgba(74, 123, 167, 0.2);
    color: #6b9dc4;
}

.btn-editar:hover {
    background: rgba(74, 123, 167, 0.4);
}

.btn-eliminar {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-eliminar:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.modal-confirm .modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px 20px;
    text-align: center;
}

.modal-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.modal-icon.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-message {
    color: white;
    font-size: 1rem;
    margin: 0 0 10px;
}

.modal-warning {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0;
}

.modal-footer {
    padding: 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-danger {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ===================================
   Formulario de Ejercicio
   =================================== */

.ejercicio-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title svg {
    width: 22px;
    height: 22px;
    color: #6b9dc4;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #4a7ba7;
    background: rgba(255, 255, 255, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select option {
    background: #1a1a2e;
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.field-error {
    display: block;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Media Upload */
.media-row {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.media-upload {
    margin-bottom: 0;
}

.upload-area {
    position: relative;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4a7ba7;
    background: rgba(74, 123, 167, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
}

.upload-placeholder svg {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.4);
}

.upload-placeholder span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.upload-hint {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.current-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    width: 100%;
}

.current-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.preview-image,
.preview-video {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    object-fit: contain;
}

.preview-image.hidden,
.preview-video.hidden {
    display: none;
}

.upload-note {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
}

/* ===================================
   Video Source Selector - Diseño Mejorado
   =================================== */

.video-source-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
    gap: 4px;
}

.source-option {
    flex: 1;
    cursor: pointer;
}

.source-option input[type="radio"] {
    display: none;
}

.source-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.source-label svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.source-option input[type="radio"]:checked + .source-label {
    background: linear-gradient(135deg, rgba(74, 123, 167, 0.3) 0%, rgba(91, 143, 185, 0.2) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 123, 167, 0.25);
}

.source-option input[type="radio"]:checked + .source-label svg {
    transform: scale(1.1);
}

/* Estilo especial para YouTube cuando está seleccionado */
.source-option input[type="radio"][value="youtube"]:checked + .source-label {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.15) 0%, rgba(200, 0, 0, 0.1) 100%);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.15);
}

.source-option input[type="radio"][value="youtube"]:checked + .source-label svg {
    fill: #FF0000;
}

.source-option:hover .source-label {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

/* ===================================
   YouTube URL Container - Diseño Mejorado
   =================================== */

.youtube-url-container {
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.youtube-input-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
    border: 2px solid rgba(255, 0, 0, 0.2);
    border-radius: 14px;
    padding: 6px 18px 6px 14px;
    transition: all 0.3s ease;
}

.youtube-input-wrapper:focus-within {
    border-color: #FF0000;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.25) 100%);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.15);
}

.youtube-input-wrapper svg {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.3));
}

.youtube-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 12px 0 !important;
    font-size: 0.95rem;
}

.youtube-input:focus {
    outline: none;
    box-shadow: none !important;
}

.youtube-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

/* Hint de formatos soportados */
.youtube-url-container .upload-hint {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 0, 0, 0.4);
}

/* ===================================
   YouTube Preview - Diseño Mejorado
   =================================== */

.youtube-preview {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    aspect-ratio: 16/9;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
}

.youtube-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF0000, #cc0000);
    z-index: 1;
}

.youtube-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 220px;
}

/* ===================================
   Media Upload Area - Diseño Mejorado
   =================================== */

.media-upload {
    position: relative;
}

.media-upload .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.upload-area {
    position: relative;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(74, 123, 167, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover::before,
.upload-area.dragover::before {
    opacity: 1;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4a7ba7;
    border-style: solid;
    background: linear-gradient(135deg, rgba(74, 123, 167, 0.08) 0%, rgba(74, 123, 167, 0.02) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 123, 167, 0.15);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 35px;
    text-align: center;
    z-index: 1;
}

.upload-placeholder svg {
    width: 56px;
    height: 56px;
    color: rgba(74, 123, 167, 0.6);
    transition: all 0.3s ease;
}

.upload-area:hover .upload-placeholder svg {
    color: #4a7ba7;
    transform: scale(1.1);
}

.upload-placeholder span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
}

.upload-placeholder .upload-hint {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    margin-top: 4px;
}

/* Current Media Preview */
.current-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    width: 100%;
}

.current-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(74, 123, 167, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
}

.preview-image,
.preview-video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Media Section Title Icon */
.media-section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(74, 123, 167, 0.2) 0%, rgba(91, 143, 185, 0.1) 100%);
    border-radius: 10px;
    margin-right: 4px;
}

.media-section-icon svg {
    width: 20px;
    height: 20px;
    color: #6b9dc4;
}

/* Responsive para Media */
@media (max-width: 768px) {
    .media-row {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .video-source-selector {
        flex-direction: column;
        gap: 4px;
        padding: 3px;
    }

    .source-label {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .source-label svg {
        width: 18px;
        height: 18px;
    }

    .upload-area {
        min-height: 180px;
    }

    .upload-placeholder {
        padding: 25px;
    }

    .upload-placeholder svg {
        width: 44px;
        height: 44px;
    }

    .youtube-input-wrapper {
        padding: 4px 12px 4px 10px;
    }

    .youtube-preview {
        max-height: 200px;
    }
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .col-equipamiento {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .btn-crear {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .filtros-form {
        flex-direction: column;
    }

    .col-dificultad,
    .col-grupo {
        display: none;
    }

    .ejercicios-table th,
    .ejercicios-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-secondary,
    .form-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Tabla responsiva - modo cards en móvil */
    .ejercicios-table-container {
        background: transparent;
        border: none;
    }

    .ejercicios-table {
        display: block;
    }

    .ejercicios-table thead {
        display: none;
    }

    .ejercicios-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .ejercicios-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        padding: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        gap: 10px;
        align-items: center;
    }

    .ejercicios-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .ejercicios-table td {
        border: none;
        padding: 0;
    }

    .ejercicios-table .col-media {
        order: 1;
    }

    .ejercicios-table .col-nombre {
        order: 2;
        flex: 1;
        min-width: 150px;
    }

    .ejercicios-table .col-acciones {
        order: 3;
        margin-left: auto;
    }

    .nombre-ejercicio {
        font-size: 1rem;
        font-weight: 600;
    }

    .acciones-btns {
        gap: 6px;
    }

    .btn-accion {
        width: 40px;
        height: 40px;
    }

    .btn-accion svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 12px;
    }

    .header {
        padding: 16px 12px;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .ejercicios-table tbody tr {
        padding: 12px;
    }
}

/* ===================================
   Búsqueda en Biblioteca
   =================================== */

.biblioteca-search-section {
    background: linear-gradient(135deg, rgba(74, 123, 167, 0.1) 0%, rgba(107, 157, 196, 0.05) 100%);
    border: 1px solid rgba(74, 123, 167, 0.3);
}

.biblioteca-search-section .section-title svg {
    color: #6b9dc4;
}

.section-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: -10px 0 20px;
    padding-left: 32px;
}

.biblioteca-search-group {
    position: relative;
}

.biblioteca-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.biblioteca-search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.biblioteca-search-input {
    padding-left: 48px !important;
    padding-right: 48px !important;
}

.biblioteca-search-loading {
    position: absolute;
    right: 16px;
}

.biblioteca-search-loading.hidden {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #6b9dc4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.biblioteca-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.biblioteca-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.biblioteca-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.biblioteca-result-item:last-child {
    border-bottom: none;
}

.biblioteca-result-item:hover {
    background: rgba(74, 123, 167, 0.15);
}

.result-main {
    flex: 1;
    min-width: 0;
}

.result-name {
    display: block;
    color: white;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.result-badges .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.result-media {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

.media-indicator {
    font-size: 0.9rem;
}

.biblioteca-no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Animación de autocompletado */
.campo-autocompletado {
    animation: pulseHighlight 0.5s ease;
    box-shadow: 0 0 0 3px rgba(74, 123, 167, 0.4) !important;
    border-color: #4a7ba7 !important;
}

@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 0 rgba(74, 123, 167, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(74, 123, 167, 0.3); }
    100% { box-shadow: 0 0 0 3px rgba(74, 123, 167, 0.4); }
}

/* Notificación de éxito */
.biblioteca-notificacion {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.biblioteca-notificacion.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.biblioteca-notificacion svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Scrollbar personalizado para resultados */
.biblioteca-results::-webkit-scrollbar {
    width: 6px;
}

.biblioteca-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.biblioteca-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.biblioteca-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive para búsqueda biblioteca */
@media (max-width: 768px) {
    .biblioteca-notificacion {
        left: 20px;
        right: 20px;
        transform: translateY(20px);
        text-align: center;
        justify-content: center;
    }

    .biblioteca-notificacion.show {
        transform: translateY(0);
    }

    .result-badges {
        display: none;
    }
}
