/*
 * 文件路径: assets/css/cbs-frontend-styles.css
 * 描述: 课程预约系统的前端样式
 */

/* --- 强制 Tab 切换 --- */
#cbs-tab-content .tab-pane {
    display: none !important; /* 强制隐藏非活动面板 */
    padding-top: 10px;
}
#cbs-tab-content .tab-pane.active {
    display: block !important; /* 强制显示活动面板 */
}

/* --- 基础容器和组件样式 --- */
#cbs-booking-container { max-width: 800px; margin: 20px auto 100px; padding: 20px; border: 1px solid #ddd; border-radius: 8px; position: relative; }
.cbs-slots-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.cbs-slot-button { background-color: #f0f0f0; border: 1px solid #ccc; padding: 8px 12px; cursor: pointer; border-radius: 4px; }
.cbs-slot-button.selected { background-color: #0073aa; color: white; border-color: #0073aa; }

/* 基础动作按钮样式 */
.cbs-action-button { background-color: #28a745; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; margin-top: 20px; }
.cbs-action-button:disabled { background-color: #6c757d; cursor: not-allowed; }
.cbs-course-type-selection label { margin-right: 20px; font-size: 1.1em; }

/* 🎯 关键修改：使按钮更大、文字更清晰 */
.cbs-action-button.cbs-small-left {
    display: block;
    width: auto;
    max-width: 300px; /* ⬅️ 宽度从 200px 增加到 300px */
    text-align: center;
    margin-left: 0;

    /* ⬇️ 新增和修改：加大按钮视觉效果和文字 */
    padding: 12px 25px;
    font-size: 1.2em; /* 增大文字尺寸 */
    font-weight: bold; /* 加粗文字 */
}


/* ---------------------------------------------------------------------- */
/* 🎯 关键修正区域：多教师轮播和选择样式 (保持不变) */
/* ---------------------------------------------------------------------- */

#cbs-teacher-carousel-wrapper {
    margin-bottom: 20px;
}

/* 轮播容器：实现横向滑动 */
.teacher-list-container {
    display: flex; /* 确保子项横向排列 */
    overflow-x: auto; /* 关键：允许横向滚动 */
    white-space: nowrap; /* 确保教师卡片不换行 */
    padding-bottom: 5px; /* 调整留白，为显示的滚动条留出空间 */
    gap: 15px;
}

/* 教师卡片/滑动项 */
.teacher-slide {
    flex: 0 0 auto; /* 关键：防止卡片被压缩，保持固定宽度 */
    width: 100px; /* 默认宽度，适应移动端 */
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

/* 响应式调整宽度：在更宽的屏幕上显示更多教师 */
@media (min-width: 500px) {
    .teacher-slide {
        width: 120px; /* 稍微放大 */
    }
}
@media (min-width: 768px) {
    .teacher-slide {
        width: 150px; /* 再次放大 */
    }
}

/* 教师照片 */
.teacher-photo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 3px solid #ccc;
    transition: border-color 0.3s ease;
}

/* 教师姓名 */
.teacher-name {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    white-space: nowrap; /* 防止姓名换行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 选中状态 */
.teacher-slide.active {
    border-color: #0073aa; /* 强调选中边框 */
    background-color: #e6f7ff; /* 浅蓝色背景 */
    transform: scale(1.05); /* 稍微放大，增加动感 */
}
.teacher-slide.active .teacher-photo {
    border-color: #0073aa; /* 强调选中照片边框 */
}

/* --- 教师信息显示 --- */
#cbs-current-teacher-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}
#cbs-current-teacher-info .staff-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    color: #666;
    border: 1px solid #ddd;
}
.staff-details h4 { margin: 0; font-size: 1.2em; }

/* 温馨提示样式 */
.cbs-booking-tips {
    margin-top: 15px;
    padding: 10px;
    border-left: 4px solid #0073aa;
    background-color: #f4f8fa;
    color: #333;
    font-size: 0.9em;
}
.cbs-booking-tips ul {
    list-style: none;
    padding-left: 0;
    margin-top: 5px;
}
.cbs-booking-tips li {
    margin-bottom: 3px;
    line-height: 1.5;
}


/* ---------------------------------------------------------------------- */
/* --- 预约记录列表样式 (新增) --- */
/* ---------------------------------------------------------------------- */

.cbs-appointment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.appointment-item {
    border: 1px solid #ddd;
    border-left: 5px solid; /* 用于状态颜色 */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #eee;
}

.appointment-datetime {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

/* 预约状态颜色区分 (需求 1) */
.appointment-item.status-booked {
    border-left-color: #0073aa; /* 蓝色: 已预约 (待上课) */
    background-color: #f7fcff;
}

.appointment-item.status-completed {
    border-left-color: #28a745; /* 绿色: 已完成 */
    background-color: #f4fff4;
}

.appointment-item.status-cancelled {
    border-left-color: #dc3545; /* 红色: 已取消 */
    background-color: #fff4f4;
}

.meeting-link-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #ffc107;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 10px;
}
.meeting-info {
    margin-top: 10px;
    padding: 8px;
    background-color: #eee;
    border-radius: 4px;
    font-size: 0.9em;
}
.meeting-info p {
    margin: 0;
}


/* ---------------------------------------------------------------------- */
/* --- 其他原有样式（保持不变） --- */
/* ---------------------------------------------------------------------- */

/* --- 我的信息表格样式 --- */
.info-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.info-table th, .info-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.info-table th { background-color: #f9f9f9; width: 30%; }
.highlight-row td { font-weight: bold; color: #0073aa; }

/* --- 🎯 响应式优化：在小屏幕上隐藏表头并堆叠 (需求 2) --- */
@media (max-width: 600px) {
    .info-table, .info-table tbody, .info-table tr, .info-table td, .info-table th {
        display: block; /* 强制所有元素堆叠 */
    }

    .info-table thead {
        display: none; /* 隐藏整个表头 */
    }

    /* ⚠️ 修复重复显示：隐藏行内定义的 <th> 标签 */
    .info-table th {
        display: none; 
    }
    /* ---------------------------------------------------- */

    .info-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .info-table td {
        border: none;
        border-bottom: 1px solid #eee; /* 仅底部边框 */
        position: relative;
        padding-left: 50%; /* 为伪元素留出空间 */
        text-align: right;
    }

    /* 模拟表头显示（需要修改 cbs-frontend-renderer.php 来配合数据属性）
     * ⚠️ 注意：这里的伪元素标签内容需要由 cbs-frontend-renderer.php 在 TD 上添加 data-label 属性来实现。
     * 鉴于我们下一步会修改 cbs-frontend-renderer.php，暂时不添加 content 属性。
     */
    .info-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #333;
    }

    /* 优化最后一行（不带边框） */
    .info-table tr:last-child {
        border-bottom: 1px solid #ddd;
    }
    .info-table tr td:last-child {
        border-bottom: none;
    }
    .highlight-row td {
        color: #dc3545; /* 高亮行在手机端也使用显眼的颜色 */
        font-size: 1.1em;
    }
}
/* --- 底部固定导航样式 --- */
#cbs-fixed-nav-wrapper { position: fixed; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid #ddd; box-shadow: 0 -2px 5px rgba(0,0,0,0.05); z-index: 1000; }
#cbs-fixed-nav { max-width: 800px; margin: 0 auto; display: flex; justify-content: space-around; padding: 10px 20px; }
.nav-button { flex-grow: 1; margin: 0 5px; background-color: #f0f0f0; border: none; padding: 10px 0; font-size: 1.1em; cursor: pointer; border-radius: 4px; }
.nav-button.active { background-color: #0073aa; color: white; }

/* --- 日期选择器样式 --- */
#cbs-date-picker {
    position: relative;
    z-index: 5;
    min-height: 40px;
}