/**
 * 課程列表頁面 — 完整 UI/UX 樣式
 * Design tokens → Sidebar → Slider → Cards
 */

/* ========================================
   0. Design Tokens
   ======================================== */
:root {
    --course-primary: #4f46e5;
    --course-primary-light: #eef2ff;
    --course-text: #1e293b;
    --course-text-secondary: #64748b;
    --course-border: #e2e8f0;
    --course-bg-subtle: #f8fafc;
    --course-radius: 12px;
    --course-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

/* ========================================
   1. Page Layout
   ======================================== */
.rbt-team-area.rbt-section-gap {
    padding-top: 30px;
}

.rbt-section-overlayping-top .col-lg-3 .rbt-sidebar-widget-wrapper {
    position: relative;
    z-index: 1;
}

/* ========================================
   2. Sidebar — 無框流式設計
   ======================================== */

/* 整體容器加一個白色卡片包裹 */
.rbt-sidebar-widget-wrapper {
    background: #fff;
    border-radius: var(--course-radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
}

/* 每個 widget 用底線分隔 */
.rbt-sidebar-widget-wrapper .rbt-single-widget {
    background: transparent;
    border-radius: 0;
    padding: 0 0 16px;
    box-shadow: none;
    margin-bottom: 16px;
    border: none;
    border-bottom: 1px solid var(--course-border);
}

.rbt-sidebar-widget-wrapper .rbt-single-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 搜尋框不需要底線 */
.rbt-sidebar-widget-wrapper .rbt-widget-search {
    border-bottom: none;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

/* Widget 標題 */
.rbt-sidebar-widget-wrapper .rbt-widget-title {
    font-family: var(--course-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--course-text);
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
    letter-spacing: 0.3px;
}

.rbt-sidebar-widget-wrapper .rbt-widget-title::before {
    display: none;
}

/* 篩選清單 */
.rbt-sidebar-widget-wrapper .rbt-sidebar-list-wrapper {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rbt-sidebar-widget-wrapper .rbt-sidebar-list-wrapper li {
    padding: 4px 0;
    font-size: 14px;
    color: var(--course-text-secondary);
}

.rbt-sidebar-widget-wrapper .rbt-sidebar-list-wrapper li label {
    font-weight: 500;
    cursor: pointer;
}

/* 顯示更多按鈕 */
.rbt-sidebar-widget-wrapper .rbt-show-more-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--course-primary);
    cursor: pointer;
    padding: 6px 0 0;
}

.rbt-sidebar-widget-wrapper .rbt-show-more-btn:hover {
    color: #3730a3;
}

/* ========================================
   3. 認證圖示（圖片與內容之間的橫行）
   ======================================== */
.course-cert-row {
    display: flex;
    gap: 5px;
    padding: 6px 16px 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.cert-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    transition: transform 0.2s ease;
}

.cert-icon:hover {
    transform: scale(1.15);
}

.cert-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s ease;
}

.cert-circle:hover {
    transform: scale(1.15);
}

/* 卡片圖片區 */
.course-grid-3 .rbt-card-img {
    position: relative;
    overflow: hidden;
}

/* ========================================
   4. 課程節數拉桿（自訂 Slider）
   ======================================== */
.lesson-slider-wrap {
    padding: 4px 0 0;
}

.lesson-track {
    position: relative;
    height: 28px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

/* 軌道底色 */
.lesson-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    transform: translateY(-50%);
    background: #e5e7eb;
    border-radius: 2px;
}

/* 填充色 */
.lesson-track-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    transform: translateY(-50%);
    background: var(--course-primary);
    border-radius: 2px;
    width: 100%;
    pointer-events: none;
}

/* 拖曳圓球 */
.lesson-thumb {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--course-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 2;
    transition: box-shadow 0.15s;
    left: 100%;
}

.lesson-thumb:hover {
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.lesson-thumb:active {
    cursor: grabbing;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.5);
}

/* 左右端點標記 */
.lesson-endcap {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 24px;
    background: #6b7280;
    border-radius: 1px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.lesson-endcap-left {
    left: 0%;
}

.lesson-endcap-right {
    left: 100%;
}

/* 標籤列 */
.lesson-slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--course-text-secondary);
    margin-top: 2px;
}

.lesson-current-value {
    font-weight: 700;
    font-size: 14px;
    color: var(--course-primary);
}

/* ========================================
   5. 課程卡片
   ======================================== */

/* 卡片容器 */
.course-card-enhanced {
    padding: 0 !important;
    border-radius: var(--course-radius) !important;
    overflow: hidden;
    border: 1px solid var(--course-border) !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.course-card-enhanced:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1) !important;
    border-color: #c7d2fe !important;
}

/* 圖片區域 */
.course-card-enhanced .rbt-card-img {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.course-card-enhanced .rbt-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.course-card-enhanced:hover .rbt-card-img::after {
    opacity: 1;
}

.course-card-enhanced .rbt-card-img img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: 100%;
    object-fit: cover;
}

.course-card-enhanced:hover .rbt-card-img img {
    transform: scale(1.04) !important;
}

/* 內容區 */
.course-card-enhanced .rbt-card-body {
    padding: 14px 16px 12px !important;
}

/* 報名人數 / 堂課 */
.course-meta-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--course-primary-light);
    color: var(--course-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
}

.meta-chip i {
    font-size: 11px;
}

/* 課程標題 */
.course-card-enhanced .rbt-card-title {
    margin: 0 0 10px !important;
}

.course-card-enhanced .rbt-card-title a {
    font-family: var(--course-font);
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--course-text) !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.course-card-enhanced:hover .rbt-card-title a {
    color: var(--course-primary) !important;
}

/* 資訊列 */
.course-info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 10px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.course-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--course-font);
    font-size: 13px;
    font-weight: 400;
    color: var(--course-text-secondary);
    line-height: 1.5;
    padding: 4px 0;
}

.course-info-item:last-child {
    border-bottom: none;
}

.course-info-item i {
    color: var(--course-primary);
    font-size: 13px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.course-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-info-item strong {
    color: var(--course-text);
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
}

/* 查看更多按鈕 */
.course-card-enhanced .rbt-card-bottom {
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid #f1f5f9;
    display: flex !important;
    justify-content: flex-end !important;
}

.course-view-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--course-primary) !important;
    background: none !important;
    padding: 4px 0 !important;
    border-radius: 0;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    margin-left: auto;
}

.course-view-btn:hover {
    color: #3730a3 !important;
    gap: 8px;
}

/* 認證圖示列 */
.course-card-enhanced .course-cert-row {
    padding: 8px 16px 2px;
    background: transparent;
}