/* Custom styles for SCL-90 assessment system - Soft Light Theme */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Custom soft color variables */
:root {
    --soft-primary: #4dabf7;
    --soft-secondary: #91a7ff;
    --soft-accent: #74c0fc;
    --soft-light: #f8f9fa;
    --soft-dark: #495057;
    --soft-success: #51cf66;
    --soft-warning: #ffd43b;
    --soft-danger: #ff6b6b;
    --soft-info: #22b8cf;
}

/* Question display styles */
.question-text {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--soft-dark);
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid var(--soft-primary);
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(73, 80, 87, 0.1);
}

.answer-options .form-check {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
}

/* 添加以下样式增强可点击感 */
.answer-options .form-check {
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.answer-options .form-check:hover {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    border-color: var(--soft-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(73, 80, 87, 0.15);
}

.answer-options .form-check-input:checked + .form-check-label {
    color: var(--soft-primary);
    font-weight: 600;
}

.answer-options .form-check:has(.form-check-input:checked) {
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    border-color: var(--soft-primary);
    box-shadow: 0 8px 25px rgba(73, 80, 87, 0.25);
    transform: translateY(-2px);
}

/* Factor card styles */
.factor-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
}

.factor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(73, 80, 87, 0.15);
    border-color: var(--soft-primary);
}

/* Progress bar custom styles */
.progress {
    background: linear-gradient(135deg, #f1f3f5 0%, #ffffff 100%);
    border-radius: 1rem;
    border: 1px solid #e9ecef;
    height: 1rem;
}

.progress-bar {
    background: linear-gradient(135deg, var(--soft-primary) 0%, var(--soft-accent) 100%);
    border-radius: 1rem;
    transition: width 0.6s ease;
}

/* Mobile responsiveness */
/* 改进移动端响应式设计 */
@media (max-width: 768px) {
    .question-text {
        font-size: 1.1rem;
        padding: 0.75rem;
    }
    
    .answer-options .form-check {
        padding: 0.5rem 0.75rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
    }
    
    .d-flex.justify-content-between > div {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card-header h3 {
        font-size: 1.5rem;
    }
    
    .card-header h5 {
        font-size: 1.2rem;
    }
    
    .row.text-center .col {
        padding: 0.25rem;
    }
    
    .row.text-center .p-2 {
        padding: 0.5rem !important;
    }
    
    .row.text-center .p-2 strong {
        font-size: 0.8rem;
    }
    
    .row.text-center .p-2 small {
        font-size: 0.7rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .factor-card {
        margin-bottom: 1rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        border-radius: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .alert button {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .factor-card {
        break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form validation styles */
.form-check-input:invalid {
    border-color: var(--bs-danger);
}

.form-check-input:valid {
    border-color: var(--bs-success);
}

/* Accessibility improvements */
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(73, 80, 87, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Custom alert styles */
.alert {
    border-radius: 0.5rem;
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 12px 30px rgba(73, 80, 87, 0.15);
    transform: translateY(-2px);
    border-color: var(--soft-primary);
}

.card-header {
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    color: var(--soft-dark);
    font-weight: 600;
    border-bottom: none;
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, var(--soft-primary) 0%, var(--soft-accent) 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #339af0 0%, #4dabf7 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(73, 80, 87, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--soft-success) 0%, #69db7c 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #40c057 0%, #69db7c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(81, 207, 102, 0.3);
}

.btn-outline-secondary {
    border: 2px solid var(--soft-secondary);
    color: var(--soft-primary);
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: var(--soft-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(145, 167, 255, 0.3);
}

/* Badge styles */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Navigation button improvements */
.btn-group .btn {
    border-radius: 0.375rem;
}

/* Responsive factor cards */
@media (max-width: 576px) {
    .factor-card {
        margin-bottom: 1rem;
    }
    
    .col-md-6 {
        margin-bottom: 0;
    }
}

/* Loading animation for buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table responsiveness */
.table-responsive {
    border-radius: 0.375rem;
}

/* Copy button animation */
.btn-success {
    transition: all 0.2s ease;
}

/* Form spacing */
.form-check + .form-check {
    margin-top: 0.75rem;
}

/* Header improvements */
.navbar-brand {
    font-weight: 600;
}

/* Card header consistency */
.card-header h3,
.card-header h4,
.card-header h5 {
    margin-bottom: 0;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.6s ease;
}

/* Code styling */
code {
    font-size: 0.875em;
    padding: 0.2rem 0.4rem;
    background-color: #f1f3f5;
    border-radius: 0.25rem;
}

/* 分段进度条样式 */
.progress {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

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

.progress-bar.bg-success {
    background: linear-gradient(135deg, #40c057 0%, #69db7c 100%);
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, #fcc419 0%, #ffd43b 100%);
}

.progress-bar.bg-danger {
    background: linear-gradient(135deg, #fa5252 0%, #ff6b6b 100%);
}

.progress-bar.bg-secondary {
    background: #dee2e6;
}

/* 进度条标签样式 */
.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.75rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .progress-labels span {
        font-size: 0.65rem;
    }
}

.progress-bar.bg-success {
    background: linear-gradient(135deg, #51cf66 0%, #69db7c 100%);
}

.progress-bar.bg-info {
    background: linear-gradient(135deg, #22b8cf 0%, #3bc9db 100%);
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, #ffd43b 0%, #fcc419 100%);
}

.progress-bar.bg-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #fa5252 100%);
}

/* 进度条悬停效果 */
.progress:hover .progress-bar {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 进度条标签 */
.progress-label {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 12px;
    font-weight: 600;
}

/* 进度条动画增强 */
.progress-bar {
    transition: width 0.8s ease, background-color 0.5s ease;
}

/* 修复进度条数字标签的位置 */
.score-scale-marks {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
}

.score-scale-marks small {
    font-size: 0.7rem;
    text-align: center;
    position: relative;
}

/* 第一个标签左对齐 */
.score-scale-marks small:first-child {
    text-align: left;
}

/* 最后一个标签右对齐 */
.score-scale-marks small:last-child {
    text-align: right;
}

/* 保持范围标签的两行显示 */
.score-range-labels {
    display: grid;
    grid-template-columns: 35.5% 14.5% 20% 30%;
    width: 100%;
    margin-top: 2px;
}

.score-range-labels span {
    font-size: 0.7rem;
    text-align: center;
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.range-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.range-value {
    display: block;
    font-size: 0.65rem;
    opacity: 0.9;
}

/* 移动端优化 */
@media (max-width: 576px) {
    .score-range-labels span {
        font-size: 0.65rem;
    }
    
    .range-value {
        font-size: 0.6rem;
    }
}

/* 修复因子进度条文字标签的排列问题 */
.col-md-9 .d-flex.justify-content-between {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    width: 100%;
}

.col-md-9 .d-flex.justify-content-between span {
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
}

/* 确保第一个和最后一个标签对齐 */
.col-md-9 .d-flex.justify-content-between span:first-child {
    text-align: left;
}

.col-md-9 .d-flex.justify-content-between span:last-child {
    text-align: right;
}

/* 移动端优化 */
@media (max-width: 576px) {
    .col-md-9 .d-flex.justify-content-between span {
        font-size: 0.65rem;
    }
    
    /* 覆盖可能导致问题的样式 */
    .d-flex.justify-content-between {
        flex-direction: row !important;
    }
    
    .d-flex.justify-content-between > div {
        width: auto !important;
        margin-bottom: 0 !important;
    }
}

/* 在文件末尾添加 */

/* 创建时间列样式 */
.table td .text-muted {
    font-size: 0.85rem;
}

/* 表格响应式优化 */
@media (max-width: 992px) {
    .table td .text-muted {
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

/* 删除按钮样式 */
#deleteSelectedBtn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 复选框样式优化 */
.form-check-input.test-checkbox {
    cursor: pointer;
}

/* 全选复选框样式 */
#selectAllCheckbox {
    cursor: pointer;
}

/* 表格中的复选框列宽度控制 */
.table th:first-child,
.table td:first-child {
    width: 40px;
    text-align: center;
}
