/* ===========================
   CURSO - ESTILOS GENERALES
   =========================== */

.cursos-container,
.curso-detalle-container,
.mis-cursos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.cursos-header,
.mis-cursos-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cursos-header h1,
.mis-cursos-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color, #1a1a1a);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted, #666);
}

/* ===========================
   CATÁLOGO - FILTROS
   =========================== */

.cursos-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.search-form {
    margin-bottom: 1rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
}

.btn-search {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: #6366f1;
    transform: translateY(-2px);
}

/* ===========================
   CATÁLOGO - GRID DE CURSOS
   =========================== */

.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.curso-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.curso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.curso-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.curso-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.curso-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.curso-category {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.curso-content {
    padding: 1.25rem;
}

.curso-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    line-height: 1.3;
}

.curso-instructor {
    font-size: 0.85rem;
    color: #6366f1;
    margin-bottom: 0.75rem;
}

.curso-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.curso-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating .fa-star,
.rating .fa-star-half-alt {
    color: #fbbf24;
}

.rating .fa-star.far {
    color: #d1d5db;
}

.rating-value {
    margin-left: 0.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.curso-level {
    margin-bottom: 1rem;
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.level-principiante {
    background: #d1fae5;
    color: #065f46;
}

.level-intermedio {
    background: #dbeafe;
    color: #1e40af;
}

.level-avanzado {
    background: #fce7f3;
    color: #9f1239;
}

.btn-ver-curso {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ver-curso:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    color: white;
}

/* ===========================
   DETALLE DE CURSO - HERO
   =========================== */

.curso-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.btn-back:hover {
    opacity: 1;
    color: white;
}

.curso-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.curso-hero-instructor {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.curso-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.rating-stars .fa-star {
    color: #fbbf24;
}

.rating-num {
    font-weight: 600;
    margin-left: 0.25rem;
}

.progreso-bar-container {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.progreso-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progreso-percent {
    font-size: 1.1rem;
}

.progreso-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progreso-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.btn-inscribirse,
.btn-continuar,
.btn-certificado {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: #6366f1;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-inscribirse:hover,
.btn-continuar:hover,
.btn-certificado:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    color: #6366f1;
}

.curso-hero-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===========================
   DETALLE DE CURSO - TABS
   =========================== */

.curso-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.descripcion-box,
.contenido-box,
.reseñas-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Lecciones List */
.lecciones-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leccion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.leccion-item:hover {
    border-color: #6366f1;
    background: #f9fafb;
}

.leccion-item.completada {
    background: #f0fdf4;
    border-color: #86efac;
}

.leccion-icon {
    font-size: 1.5rem;
    color: #6366f1;
}

.leccion-item.completada .leccion-icon {
    color: #10b981;
}

.leccion-info {
    flex: 1;
}

.leccion-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.leccion-desc {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.leccion-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.quiz-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.btn-play-leccion {
    padding: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-play-leccion:hover {
    transform: scale(1.1);
    color: white;
}

/* Reseñas */
.dejar-reseña {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.stars-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.stars-input input {
    display: none;
}

.stars-input label {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.stars-input input:checked~label,
.stars-input label:hover,
.stars-input label:hover~label,
.stars-input label.selected {
    color: #fbbf24;
}

.reseñas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reseña-item {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.reseña-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.reseña-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.reseña-rating .fa-star {
    color: #fb bf24;
}

.reseña-comentario {
    margin: 0.5rem 0;
    color: #4b5563;
}

.reseña-fecha {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ==========================
   MIS CURSOS
   ========================== */

.cursos-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tab:hover,
.filter-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: #6366f1;
}

.mis-cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.mi-curso-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mi-curso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.curso-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.curso-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.curso-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.curso-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.curso-badge.completado {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.curso-badge.en-progreso {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

.curso-info {
    padding: 1.5rem;
}

.curso-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.progreso-section {
    margin-bottom: 1rem;
}

.progreso-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.curso-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.curso-stats-row .stat {
    font-size: 0.85rem;
    color: #666;
}

.curso-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-continuar,
.btn-comenzar {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-certificado,
.btn-generar-cert {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-ver-detalles {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================
   ESTADOS VACÍOS
   ========================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
}

.btn-explorar {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-explorar:hover {
    transform: translateY(-2px);
    color: white;
}

/* ==========================
   RESPONSIVE
   ========================== */

@media (max-width: 768px) {
    .curso-hero {
        grid-template-columns: 1fr;
    }

    .curso-hero-title {
        font-size: 2rem;
    }

    .cursos-grid,
    .mis-cursos-grid {
        grid-template-columns: 1fr;
    }

    .curso-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }
}

/* ==========================
   DARK MODE
   ========================== */

@media (prefers-color-scheme: dark) {

    .cursos-filters,
    .curso-card,
    .descripcion-box,
    .contenido-box,
    .reseñas-box,
    .mi-curso-card,
    .empty-state {
        background: #1e293b;
        color: #e2e8f0;
    }

    .curso-title,
    .curso-name,
    .curso-hero-title,
    .empty-state h3 {
        color: #f1f5f9;
    }

    .search-input,
    .category-btn,
    .leccion-item,
    .reseña-item,
    .filter-tab {
        background: #0f172a;
        color: #e2e8f0;
        border-color: #475569;
    }

    .btn-ver-detalles {
        background: #334155;
        color: #e2e8f0;
    }
}