/* ========================================
   Biblioteca de Cursos - Estilos Frontend
   ======================================== */

/* Variables CSS */
:root {
    --bc-primary: #0073aa;
    --bc-primary-hover: #005a87;
    --bc-success: #46b450;
    --bc-warning: #ffb900;
    --bc-danger: #dc3232;
    --bc-info: #00a0d2;
    --bc-gray-100: #f9f9f9;
    --bc-gray-200: #e5e5e5;
    --bc-gray-300: #ccc;
    --bc-gray-700: #555;
    --bc-gray-900: #1e1e1e;
    --bc-border-radius: 8px;
    --bc-transition: all 0.3s ease;
}

/* ========================================
   Grid de Cursos
   ======================================== */
.bc-cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.bc-curso-card {
    background: #fff;
    border: 1px solid var(--bc-gray-200);
    border-radius: var(--bc-border-radius);
    overflow: hidden;
    transition: var(--bc-transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bc-curso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.bc-curso-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.bc-curso-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--bc-transition);
}

.bc-curso-card:hover .bc-curso-thumbnail img {
    transform: scale(1.05);
}

.bc-curso-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.bc-badge-completado,
.bc-badge-progreso {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.bc-badge-completado {
    background: var(--bc-success);
}

.bc-badge-progreso {
    background: var(--bc-warning);
}

.bc-curso-content {
    padding: 1.5rem;
}

.bc-curso-titulo {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.bc-curso-titulo a {
    color: var(--bc-gray-900);
    text-decoration: none;
    transition: var(--bc-transition);
}

.bc-curso-titulo a:hover {
    color: var(--bc-primary);
}

.bc-curso-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--bc-gray-700);
}

.bc-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bc-meta-item .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.bc-nivel-principiante { color: var(--bc-success); }
.bc-nivel-intermedio { color: var(--bc-warning); }
.bc-nivel-avanzado { color: var(--bc-danger); }

.bc-curso-excerpt {
    color: var(--bc-gray-700);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ========================================
   Barra de Progreso
   ======================================== */
.bc-curso-progreso,
.bc-progreso-general {
    margin: 1.5rem 0;
}

.bc-progreso-info,
.bc-progreso-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--bc-gray-700);
}

.bc-progreso-porcentaje {
    font-weight: 600;
    color: var(--bc-primary);
}

.bc-progreso-barra {
    width: 100%;
    height: 8px;
    background: var(--bc-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.bc-progreso-barra-grande {
    height: 12px;
}

.bc-progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bc-primary), var(--bc-info));
    transition: width 0.6s ease;
    border-radius: 4px;
}

/* ========================================
   Botones
   ======================================== */
.bc-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--bc-border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--bc-transition);
    width: 100%;
}

.bc-btn-primary {
    background: var(--bc-primary);
    color: #fff;
}

.bc-btn-primary:hover {
    background: var(--bc-primary-hover);
    color: #fff;
}

/* ========================================
   Contenido del Curso
   ======================================== */
.bc-curso-contenido {
    background: #fff;
    padding: 2rem;
    border-radius: var(--bc-border-radius);
    margin: 2rem 0;
}

.bc-progreso-general {
    background: var(--bc-gray-100);
    padding: 1.5rem;
    border-radius: var(--bc-border-radius);
    margin-bottom: 2rem;
}

.bc-progreso-general h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--bc-gray-900);
}

.bc-curso-completado {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #ecf7ed;
    border: 1px solid var(--bc-success);
    border-radius: var(--bc-border-radius);
    color: #177622;
    font-weight: 600;
}

.bc-curso-completado .dashicons {
    color: var(--bc-success);
}

/* ========================================
   Lista de Lecciones
   ======================================== */
.bc-lecciones-lista {
    margin-top: 2rem;
}

.bc-lecciones-lista h3 {
    margin-bottom: 1.5rem;
    color: var(--bc-gray-900);
}

.bc-leccion-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border: 2px solid var(--bc-gray-200);
    border-radius: var(--bc-border-radius);
    margin-bottom: 1rem;
    transition: var(--bc-transition);
}

.bc-leccion-item:hover {
    border-color: var(--bc-primary);
}

.bc-leccion-completada {
    background: #f0f9ff;
    border-color: var(--bc-success);
}

.bc-leccion-numero {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bc-gray-100);
    border-radius: 50%;
    font-weight: 700;
    color: var(--bc-gray-700);
}

.bc-leccion-completada .bc-leccion-numero {
    background: var(--bc-success);
    color: #fff;
}

.bc-leccion-info {
    flex-grow: 1;
}

.bc-leccion-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--bc-gray-900);
}

.bc-leccion-duracion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--bc-gray-700);
}

.bc-leccion-duracion .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* ========================================
   Checkbox Personalizado
   ======================================== */
.bc-checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.bc-checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.bc-checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid var(--bc-gray-300);
    border-radius: 4px;
    transition: var(--bc-transition);
}

.bc-checkbox-container:hover .bc-checkmark {
    border-color: var(--bc-primary);
}

.bc-checkbox-container input:checked ~ .bc-checkmark {
    background-color: var(--bc-success);
    border-color: var(--bc-success);
}

.bc-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bc-checkbox-container input:checked ~ .bc-checkmark:after {
    display: block;
}

.bc-checkbox-label {
    font-size: 0.875rem;
    color: var(--bc-gray-700);
    font-weight: 500;
}

/* ========================================
   Estadísticas
   ======================================== */
.bc-estadisticas {
    background: #fff;
    padding: 2rem;
    border-radius: var(--bc-border-radius);
    margin: 2rem 0;
}

.bc-estadisticas h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--bc-gray-900);
}

.bc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.bc-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bc-gray-100);
    border-radius: var(--bc-border-radius);
    border-left: 4px solid var(--bc-primary);
}

.bc-stat-success { border-left-color: var(--bc-success); }
.bc-stat-warning { border-left-color: var(--bc-warning); }
.bc-stat-info { border-left-color: var(--bc-info); }

.bc-stat-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
}

.bc-stat-icon .dashicons {
    width: 28px;
    height: 28px;
    font-size: 28px;
    color: var(--bc-primary);
}

.bc-stat-success .bc-stat-icon .dashicons { color: var(--bc-success); }
.bc-stat-warning .bc-stat-icon .dashicons { color: var(--bc-warning); }
.bc-stat-info .bc-stat-icon .dashicons { color: var(--bc-info); }

.bc-stat-info {
    flex-grow: 1;
}

.bc-stat-numero {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bc-gray-900);
    line-height: 1;
}

.bc-stat-label {
    font-size: 0.875rem;
    color: var(--bc-gray-700);
    margin-top: 0.25rem;
}

/* ========================================
   Alertas
   ======================================== */
.bc-alert {
    padding: 1rem 1.5rem;
    border-radius: var(--bc-border-radius);
    margin: 1.5rem 0;
}

.bc-alert-info {
    background: #e5f5fa;
    border-left: 4px solid var(--bc-info);
    color: #00516d;
}

.bc-alert-warning {
    background: #fff8e5;
    border-left: 4px solid var(--bc-warning);
    color: #94660c;
}

.bc-alert-success {
    background: #ecf7ed;
    border-left: 4px solid var(--bc-success);
    color: #177622;
}

.bc-alert-danger {
    background: #f9dddc;
    border-left: 4px solid var(--bc-danger);
    color: #761919;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .bc-cursos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .bc-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bc-leccion-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bc-leccion-acciones {
        width: 100%;
    }
    
    .bc-curso-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

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

.bc-curso-card,
.bc-leccion-item {
    animation: fadeIn 0.5s ease;
}
