/* index.css — 首頁 專屬樣式 */

/* 購物車按鈕 hover 效果 */
.btn-outline-primary.cart-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Banner carousel */
.carousel-item {
    height: auto;
}

.carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Category */
.category-item {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background-color: white;
    transition: transform 0.3s;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Instructor */
.instructor-card {
    text-align: center;
}

.instructor-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 3px solid var(--primary-color);
}

/* Article card styles */
.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.article-card .card-img-container {
    position: relative;
    overflow: hidden;
}

.article-card .card-img-top {
    transition: transform 0.3s ease;
}

.article-card:hover .card-img-top {
    transform: scale(1.05);
}

.article-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.article-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category badge */
.category-badge {
    position: absolute;
    top: 125px;
    right: 10px;
    background-color: #eeeeee;
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Course stats */
.course-stats {
    display: flex;
    font-size: 0.8rem;
    color: #6c757d;
}

.course-stats div {
    margin-right: 10px;
}

/* 精選課程卡片 card-body flex 排版 */
.py-5 .card .card-body {
    display: flex;
    flex-direction: column;
}

/* 立即購買按鈕 */
.btn-buy-now {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background-color 0.3s;
}

.card:hover .btn-buy-now {
    background-color: #9d4517;
}

/* 橫向滾動卡片容器 */
.card-scroll-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.card-scroll-container::-webkit-scrollbar {
    display: none;
}

.card-scroll-item {
    min-width: 320px;
    max-width: 320px;
    flex: 0 0 320px;
}

.card-scroll-item .card {
    height: 100%;
}

.card-scroll-item .card-img-top {
    width: 100%;
    height: 188px;
    object-fit: fill;
}

/* 滾動箭頭按鈕 */
.scroll-nav {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.scroll-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 14px;
}

.scroll-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 倒三角形平台介紹 */
.intro-section {
    position: relative;
    background-color: #fafafa;
}

.intro-angle {
    background-color: #bd561b;
    clip-path: polygon(0 0, 100% 0,
            100% 40%,
            52% 95%, 51% 96.5%, 50% 97%, 49% 96.5%, 48% 95%,
            0 40%);
    padding: 30px 15% 100px;
    text-align: center;
}

.intro-text {
    max-width: 420px;
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 2;
    color: #fff;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .intro-angle {
        clip-path: polygon(0 0, 100% 0,
                100% 50%,
                51.5% 95.8%, 50.8% 96.5%, 50% 97%, 49.2% 96.2%, 48.5% 95.5%,
                0 50%);
        padding: 25px 8% 90px;
    }

    .intro-text {
        font-size: 0.85rem;
    }

    .carousel-item {
        height: 300px;
    }

    footer {
        margin-bottom: 60px;
    }
}