/* 应急救援学习平台 - 自定义样式 */

/* 全局样式 */
:root {
    --rescue-red: #dc3545;
    --rescue-dark: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
}

.bg-rescue {
    background-color: var(--rescue-red) !important;
}

/* 卡片样式 */
.card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 模块卡片 */
.module-card {
    cursor: pointer;
    border: none;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
}

.module-card .card-body {
    padding: 1.5rem;
}

.module-card .module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 考试题目样式 */
.exam-question {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--rescue-red);
}

.exam-option {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.exam-option:hover {
    background-color: #f8f9fa;
}

.exam-option.selected {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--rescue-red);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* 论坛帖子 */
.forum-post {
    transition: all 0.2s;
}

.forum-post:hover {
    background-color: #fff;
}

/* 商城产品卡片 */
.product-card {
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* 错题本 */
.error-item {
    background-color: #fff;
    border-left: 3px solid #dc3545;
}

.error-item.corrected {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
}

/* 视频容器 */
.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-container video {
    display: block;
    width: 100%;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .module-card .card-body {
        padding: 1.25rem;
    }
}

@media (max-width: 992px) {
    .module-card .module-icon {
        font-size: 2.5rem;
    }
    
    .card-header h4, .card-header h5 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .module-card .card-body {
        padding: 1rem;
    }
    
    .module-card .module-icon {
        font-size: 2rem;
    }
    
    .exam-question {
        padding: 1rem;
    }
    
    /* 移动端导航栏调整 */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand i {
        font-size: 1.2rem;
    }
    
    /* 移动端按钮调整 */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* 移动端控制按钮布局 */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between > div {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    
    /* 移动端题目导航 */
    .question-nav-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
        padding: 0;
    }
    
    /* 移动端题目内容 */
    .question-item .card-body {
        padding: 1rem;
    }
    
    .question-item h5 {
        font-size: 1rem;
    }
    
    /* 移动端表单元素 */
    .form-control {
        font-size: 0.9rem;
    }
    
    /* 移动端卡片间距 */
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-header h4, .card-header h5 {
        font-size: 1rem;
    }
    
    .module-card .module-icon {
        font-size: 1.5rem;
    }
    
    /* 移动端题目选项 */
    .question-option {
        font-size: 0.85rem;
    }
    
    /* 移动端页脚 */
    footer .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    /* 移动端统计卡片 */
    .card-body.text-center.py-4 {
        padding: 1.5rem 1rem !important;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
}

/* 进度条 */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* 按钮样式 */
.btn-danger {
    background-color: var(--rescue-red);
    border-color: var(--rescue-red);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* 列表组样式 */
.list-group-item.active {
    background-color: var(--rescue-red);
    border-color: var(--rescue-red);
}

/* 后台管理样式 */
.list-group-item-action.active {
    background-color: var(--rescue-red);
    border-color: var(--rescue-red);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
