﻿/* ============================================================
   wwwroot/css/shared-components.css
   (Chứa các khối UI được dùng chung trên nhiều trang: Courses, Home...)
   ============================================================ */

/* ── 1. KHỐI CHƯƠNG TRÌNH HỌC (COURSES GRID & CARD) ── */
.yq-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.yq-course-card {
    background-color: transparent !important;
    border: 1.5px solid #E8C167;
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: box-shadow 0.25s, transform 0.25s, background-color 0.25s;
    height: 100%;
}

    .yq-course-card:hover {
        box-shadow: 0 8px 24px rgba(232, 193, 103, 0.25);
        transform: translateY(-4px);
        background-color: #fff !important;
    }

.yq-course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.yq-course-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.yq-title-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--yq-red);
    background: rgba(192, 57, 43, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.yq-title-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.yq-course-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--yq-text);
    margin: 0;
    line-height: 1.3;
}

.yq-course-info p {
    font-size: 1rem;
    color: var(--yq-text-mid);
    margin: 0;
    line-height: 1.6;
}

.yq-course-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-shrink: 0;
    min-width: 110px;
}

.yq-course-img {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .yq-course-img img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.yq-btn-course {
    display: inline-block;
    background: transparent;
    border: 1.5px solid #D9A036;
    color: #D9A036;
    border-radius: 30px;
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

    .yq-btn-course:hover {
        background: #D9A036;
        color: #fff;
    }


/* ── 2. KHỐI CAROUSEL & ĐÁNH GIÁ (TESTIMONIALS / SIMILAR COURSES) ── */
.yq-carousel-wrapper {
    position: relative;
    /*max-width: 1200px;*/
    max-width: 85%;
    margin: 0 auto;
    padding: 0 55px;
}

.yq-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.yq-testimonial-card {
    background-color: #fff !important;
    border: 1.5px solid var(--yq-border);
    border-radius: 14px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    text-align: left;
    transition: box-shadow 0.2s ease;
}

    .yq-testimonial-card:hover {
        box-shadow: var(--yq-shadow);
    }

.yq-score {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--yq-text-mid);
}

    .yq-score strong {
        color: var(--yq-red);
        font-weight: 700;
    }

.yq-testimonial-quote {
    font-size: 1.05rem;
    color: var(--yq-text-mid);
    line-height: 1.6;
    font-style: normal;
    margin: 0;
}

.yq-reviewer {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-top: 1px dashed rgba(192, 57, 43, 0.2);
    padding-top: 1rem;
}

.yq-reviewer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #fff !important;
    flex-shrink: 0;
}

    .yq-reviewer-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.yq-reviewer-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

    .yq-reviewer-info strong {
        font-size: 1.1rem;
        color: var(--yq-text);
    }

    .yq-reviewer-info span {
        font-size: 0.85rem;
        color: var(--yq-text-mid);
    }

.yq-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1.5px solid #e5e5e5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

    .yq-carousel-btn:hover {
        background: var(--yq-red);
        color: #fff;
        border-color: var(--yq-red);
    }

.yq-carousel-btn--prev {
    left: 0;
}

.yq-carousel-btn--next {
    right: 0;
}


/* ── 3. RESPONSIVE DÀNH CHO CÁC COMPONENT DÙNG CHUNG ── */
@media (max-width: 1024px) {
    .yq-courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .yq-carousel-btn {
        display: none !important;
    }

    .yq-carousel-wrapper {
        padding: 0;
    }

    /* Ép cuộn ngang cho các Grid */
    .yq-testimonials-grid,
    .yq-courses-grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
        gap: 1.2rem;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem 1rem 1rem;
    }

        .yq-testimonials-grid::-webkit-scrollbar,
        .yq-courses-grid::-webkit-scrollbar {
            display: none;
        }

    .yq-testimonial-card,
    .yq-course-card {
        flex: 0 0 85%;
        scroll-snap-align: center;
        height: auto;
    }

    /* Bố cục khóa học 2 cột bên trong Card (Mobile) */
    .yq-course-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        text-align: left;
        padding: 1.25rem 1rem;
        /* Ghi đè transparent !important ở gốc bằng màu nền mới */
        background-color: #FFFBEF !important;
        border: 1px solid var(--yq-border);
    }

    .yq-course-info {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.2rem;
    }

    .yq-course-title {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.4rem;
    }

        .yq-course-title h3 {
            font-size: 1.25rem;
            line-height: 1.3;
            margin: 0;
        }

    .yq-course-info p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin: 0;
    }

    .yq-course-visual {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
    }

    .yq-course-img {
        width: 120px;
        height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .yq-course-img img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

    .yq-btn-course {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
        color: #B12821;
        border: #0D0C07 1.5px solid;
        background-color: #D9A036;
    }
}

@media (min-width: 1921px) {
    .yq-courses-grid {
        max-width: 90%;
        gap: 2.8rem;
    }

    .yq-course-card {
        padding: 2.5rem 2rem;
    }

    .yq-course-title h3 {
        font-size: 1.4rem;
    }

    .yq-course-info p {
        font-size: 1.1rem;
    }

    .yq-course-img {
        width: 130px;
        height: 130px;
    }

    .yq-carousel-wrapper {
        max-width: 90%;
    }

    .yq-testimonial-quote {
        font-size: 1.15rem;
    }
}
