/* ============================================================
   Carrusel de cursos
   ============================================================ */

.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto;
    overflow: hidden;
    padding: 20px 10px;
    box-sizing: border-box;
}

/* Track deslizante donde van las tarjetas (carousel-item) */
.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    gap: 20px;
    position: relative;
}

/* Cada tarjeta del carrusel */
.carousel-item {
    flex: 0 0 33.33%;
    box-sizing: border-box;
    background: linear-gradient(160deg, #383838 0%, #2a2a2a 100%);
    border: 1px solid rgba(190, 239, 190, 0.12);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.45;
    transform: scale(0.92);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    will-change: transform;
    overflow: hidden;
}

.carousel-item:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(152, 255, 152, 0.12);
    border-color: rgba(152, 255, 152, 0.4);
    z-index: 2;
}

/* Tarjeta activa, centrada */
.carousel-item.active {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(190, 239, 190, 0.3);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

/* Contenedor de la imagen superior */
.course-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.course-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(42, 42, 42, 0) 70%, rgba(42, 42, 42, 0.9) 100%);
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-item:hover .course-image img {
    transform: scale(1.06);
}

/* Contenedor de la información del curso */
.course-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

/* ==== Estrellas y rating ==== */
.course-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.participants-count {
    color: #9e9e9e;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.participant-icon {
    filter: brightness(0.8);
    font-size: 1.2rem;
}

.course-rating .star {
    font-size: 1.3rem;
    margin-right: -5px;
}

.course-rating .star.full {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.course-rating .star.empty {
    color: #616161;
}

.course-rating .rating-count {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 500;
    margin-left: 8px;
}

/* ==== Título del curso ==== */
.course-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f2f8f2;
    margin: 0 0 15px;
    line-height: 1.3;
}

/* ==== Meta: autor, etc. ==== */
.course-meta {
    margin-top: 15px;
}

.author-name {
    color: #a9b5a9;
    font-size: 0.95rem;
}

.author-name strong {
    color: #98ff98;
}

/* ==== Botón de la tarjeta (Inscribirse) ==== */
.course-actions {
    margin-top: 20px;
    text-align: center;
}

.enroll-button {
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(120deg, #43bb43, #078207);
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(7, 130, 7, 0.3);
    border: 1px solid rgba(152, 255, 152, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.enroll-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(7, 130, 7, 0.4), 0 0 18px rgba(152, 255, 152, 0.25);
}

.enroll-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(7, 130, 7, 0.2);
}

/* Botones de navegación (Flechas) */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(29, 29, 29, 0.7);
    border: 1px solid rgba(190, 239, 190, 0.35);
    color: #beefbe;
    font-size: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(152, 255, 152, 0.15);
    border-color: #98ff98;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(152, 255, 152, 0.25);
    transform: translateY(-50%) scale(1.08);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* ==================== */
/* RESPONSIVE DESIGN */
/* ==================== */

/* Móviles (hasta 767px) */
@media screen and (max-width: 767px) {
    .carousel-item {
        flex: 0 0 100%;
    }

    .course-title {
        font-size: 1.2rem;
    }

    .course-rating {
        flex-wrap: wrap;
        gap: 8px;
    }

    .course-rating .star {
        font-size: 1.1rem;
    }

    .course-rating .rating-count {
        font-size: 0.9rem;
    }

    .participants-count {
        font-size: 0.9rem;
    }

    .enroll-button {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .carousel-container {
        padding-left: 3em;
        padding-right: 1.8em;
    }

    .course-image {
        height: 180px;
    }
}
