/* ==========================================================================
   BeHere LMS - Frontend Custom Styles
   前台專用：只套用於 <body class="behere-frontend">，不影響後台 AdminLTE。
   原則：Bootstrap 4 打底，behere-* class 點綴，不覆寫 Bootstrap 底層。
   ========================================================================== */

/* 1. Design Tokens（換主題只需改這裡） */
:root {
    --behere-primary: #0056b3;
    --behere-primary-hover: #004494;
    --behere-accent: #f39c12;
    --behere-accent-hover: #d68910;

    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;

    --border-radius: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2. 全域基礎 */
body.behere-frontend {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

body.behere-frontend h1,
body.behere-frontend h2,
body.behere-frontend h3,
body.behere-frontend h4,
body.behere-frontend h5,
body.behere-frontend h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.behere-main-content {
    min-height: 60vh;
}

/* 3. 導航列（白底現代風） */
.behere-navbar {
    padding: 12px 0;
    background: #ffffff !important;
    box-shadow: var(--shadow-sm);
}

.behere-navbar .navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--behere-primary) !important;
}

.behere-navbar .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: var(--transition);
}

.behere-navbar .nav-link:hover {
    color: var(--behere-primary) !important;
    background-color: rgba(0, 86, 179, 0.05);
}

/* 4. Hero 區塊 */
.behere-hero {
    background: linear-gradient(135deg, var(--behere-primary) 0%, #007bff 50%, #00a8ff 100%);
    color: #ffffff;
    padding: 90px 0 110px;
    border-radius: 0 0 50px 50px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.behere-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.behere-hero h1 {
    color: #ffffff;
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.behere-hero .lead {
    font-size: 1.25rem;
    opacity: 0.92;
    margin-bottom: 30px;
}

/* ==========================================================================
   搜索框布局修复 (Search Box Fix)
   ========================================================================== */

/* 1. 限制搜索框总宽度，并居中 */
.behere-search-box {
    max-width: 600px;  /* 限制最大宽度，防止在大屏幕上太宽 */
    margin: 0 auto;    /* 居中 */
    width: 100%;       /* 小屏幕上占满 */
}

/* 2. 输入框样式调整 */
.behere-search-box .form-control {
    border-radius: 50px 0 0 50px; /* 左边圆角 */
    border-right: none;           /* 去掉右边框，跟按钮融合 */
    flex-grow: 1;                 /* 占据剩余空间 */
    min-width: 0;                 /* 【关键】防止 Flex 子项溢出导致布局崩坏 */
    padding: 0.75rem 1.5rem;      /* 增加内边距，让字不贴边 */
    height: auto;
}

/* 3. 搜索按钮样式调整 */
.behere-search-box .btn {
    border-radius: 0 50px 50px 0; /* 右边圆角 */
    white-space: nowrap;          /* 【关键】强制文字不换行 */
    flex-shrink: 0;               /* 【关键】防止按钮被输入框挤压 */
    padding: 0.6rem 1.5rem;       /* 上下左右内边距，确保文字有空间 */
    display: flex;                /* 让图标和文字垂直居中 */
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background-color: var(--behere-accent, #f39c12); /* 确保是品牌色 */
    border: none;
    color: #fff;
}

/* 鼠标悬停效果 */
.behere-search-box .btn:hover {
    background-color: var(--behere-accent-hover, #d68910);
    color: #fff;
}

/* 5. 按鈕（膠囊造型） */
.btn-behere-primary {
    background-color: var(--behere-primary);
    border-color: var(--behere-primary);
    color: #fff;
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-behere-primary:hover,
.btn-behere-primary:focus {
    background-color: var(--behere-primary-hover);
    border-color: var(--behere-primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.3);
}

.btn-behere-outline {
    border: 2px solid var(--behere-primary);
    color: var(--behere-primary);
    border-radius: 50px;
    padding: 8px 22px;
    font-weight: 600;
    background: transparent;
    transition: var(--transition);
}

.btn-behere-outline:hover {
    background-color: var(--behere-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* 6. 卡片（課程卡片 hover 上浮） */
body.behere-frontend .card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background-color: var(--bg-card);
}

.behere-course-card {
    overflow: hidden;
    /* height: 100%; */
}

.behere-course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.behere-course-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.behere-course-card:hover .card-img-top {
    transform: scale(1.05);
}

.behere-course-card .card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* 7. 頁尾 */
.behere-footer {
    background-color: #1a252f;
    color: #bdc3c7;
    padding-top: 60px;
    margin-top: 80px;
}

.behere-footer h5 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.behere-footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s;
}

.behere-footer a:hover {
    color: var(--behere-accent);
}

/* 8. 響應式微調 */
@media (max-width: 768px) {
    .behere-hero {
        padding: 60px 0 80px;
        border-radius: 0 0 30px 30px;
    }

    .behere-hero h1 {
        font-size: 2rem;
    }

    .behere-search-box {
        flex-direction: column;
        border-radius: 15px;
        padding: 15px;
    }

    .behere-search-box input {
        border-radius: 10px;
        margin-bottom: 10px;
        width: 100%;
    }

    .behere-search-box .btn {
        border-radius: 10px;
        width: 100%;
    }
}
/* ==========================================================================
   登入/註冊頁面專屬美化 (Login & Register Page)
   只套用 behere-* class，不影響首頁或其他頁面
   ========================================================================== */

/* 1. 背景與垂直居中佈局 */
.behere-login-wrapper {
    /* 淡淡的灰藍漸變背景，呼應 Hero 區但不搶眼 */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    /* 計算高度：減去 Header 和 Footer 的大約高度，確保完美居中 */
    min-height: calc(100vh - 250px);
    display: flex;
    align-items: center;
    padding: 40px 0;
}

/* 2. 登入卡片質感提升 */
.behere-login-card {
    border: none;
    border-radius: 16px; /* 更大的圓角，更現代 */
    overflow: hidden; /* 確保內部元素不會撐破圓角 */
    box-shadow: 0 15px 35px rgba(0, 86, 179, 0.08); /* 帶有品牌色調的柔和大陰影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 3. 卡片頂部標題欄 (品牌漸變) */
.behere-login-card .card-header {
    background: linear-gradient(135deg, var(--behere-primary) 0%, #007bff 100%);
    border-bottom: none;
    padding: 25px 20px;
    color: #ffffff;
}

.behere-login-card .card-header h5 {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 4. 表單輸入框美化 (Focus 光暈效果) */
.behere-login-card .form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.behere-login-card .form-control {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
    font-size: 1rem;
    background-color: #f8f9fa;
}

/* 輸入框獲得焦點時，顯示品牌藍光暈 */
.behere-login-card .form-control:focus {
    border-color: var(--behere-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
    outline: none;
}

/* 5. 登入按鈕美化 (漸變 + 懸停上浮) */
.behere-login-card .btn-login {
    border-radius: 10px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--behere-primary) 0%, #007bff 100%);
    border: none;
    color: #ffffff;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.behere-login-card .btn-login:hover {
    transform: translateY(-2px); /* 懸停微微上浮 */
    box-shadow: 0 8px 20px rgba(0, 86, 179, 0.3); /* 懸停陰影加深 */
    background: linear-gradient(135deg, var(--behere-primary-hover) 0%, #0056b3 100%);
    color: #ffffff;
}

/* 6. 卡片底部連結區 */
.behere-login-card .card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #eaedf1;
    padding: 20px;
}

/* 7. 手機版響應式微調 */
@media (max-width: 576px) {
    .behere-login-wrapper {
        min-height: auto; /* 手機版取消固定高度，讓內容自然撐開 */
        padding: 20px 0;
    }

    .behere-login-card {
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
}

/* ==========================================================================
   課程詳情頁 & 報名 CTA (Course Detail & Enrollment)
   ========================================================================== */

/* Course card */
.behere-course-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.behere-course-img {
    object-fit: cover;
    height: 100%;
    min-height: 220px;
}

/* Sticky CTA */
.behere-cta-sticky {
    position: sticky;
}

.behere-cta-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.behere-cta-card .card-body {
    padding: 24px;
}

/* Progress bar */
.behere-progress-wrapper .progress {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
}

.behere-progress-wrapper .progress-bar {
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* Enrollment guide */
.behere-enrollment-guide {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.behere-step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.behere-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--behere-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.behere-boc-info {
    border: 1px solid #dee2e6;
}

.behere-qr-img {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

/* Order cards */
.behere-order-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.behere-order-card:hover {
    box-shadow: var(--shadow-md);
}

/* Lesson list */
.behere-lesson-list .list-group-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.behere-lesson-list .list-group-item:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 991px) {
    .behere-cta-sticky {
        position: relative !important;
        top: 0 !important;
        margin-top: 24px;
    }
}
}