/* 进度页面专用样式 */
/* Fixed Navbar Spacer */
.fixed-top-spacer {
    height: 70px; /* Adjust based on actual navbar height */
}

.progress-container {
    padding: 2rem 0;
    margin-top: 20px;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stats-item {
    text-align: center;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.subject-progress {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.subject-progress .subject-name {
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: #333;
}

.subject-progress .progress {
    height: 28px !important;
    background-color: #e9ecef;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    margin-bottom: 0.8rem;
}

.subject-progress .progress-bar {
    border-radius: 14px;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 28px !important;
    text-align: center;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.subject-progress .progress-bar.bg-primary {
    background: linear-gradient(45deg, #007bff, #0056b3) !important;
}

.subject-progress .progress-bar.bg-danger {
    background: linear-gradient(45deg, #dc3545, #a71e2a) !important;
}

.subject-progress .progress-bar.bg-success {
    background: linear-gradient(45deg, #28a745, #1e7e34) !important;
}

.subject-progress .progress-bar.bg-warning {
    background: linear-gradient(45deg, #ffc107, #d39e00) !important;
    color: #333 !important;
    text-shadow: none;
}

.subject-progress .progress-bar.bg-info {
    background: linear-gradient(45deg, #17a2b8, #117a8b) !important;
}

.subject-progress .progress-bar.bg-secondary {
    background: linear-gradient(45deg, #6c757d, #545b62) !important;
}

.subject-progress .progress-bar.bg-dark {
    background: linear-gradient(45deg, #343a40, #1d2124) !important;
}

.subject-progress .progress-bar {
    animation: progressBarFill 1.5s ease-out;
}

@keyframes progressBarFill {
    0% {
        width: 0% !important;
    }
}

.subject-progress .progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #dee2e6;
}

.subject-progress .progress-details small {
    color: #6c757d;
    font-size: 0.85rem;
}

.subject-progress .progress-details .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.subject-progress .progress-details .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wrong-question-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.wrong-question-item:hover {
    background: #fff1b3;
    transform: translateY(-2px);
}

.question-meta {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.achievement-badge {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    margin: 0.5rem;
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.achievement-badge.locked {
    background: #e9ecef;
    color: #6c757d;
    box-shadow: none;
}

.study-streak {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.streak-number {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(26, 1fr); /* 改为26列，每列代表一周 */
    grid-template-rows: repeat(7, 1fr); /* 7行，每行代表一天 */
    gap: 2px; /* 减小间距以适应更多格子 */
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 280px; /* 设置固定高度 */
    width: 100%;
    overflow: hidden;
}

.calendar-day {
    width: 100%; /* 自适应宽度 */
    height: 100%; /* 自适应高度 */
    min-width: 18px; /* 最小宽度 */
    min-height: 18px; /* 最小高度 */
    border-radius: 4px; /* 稍微小一点的圆角 */
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem; /* 稍小的字体 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef; /* 更细的边框 */
    color: #6c757d;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    border-color: #007bff !important;
    font-weight: bold;
}

.calendar-day.intensity-1 {
    background: linear-gradient(135deg, #c3f0ca 0%, #a8e6cf 100%);
    border-color: #28a745;
    color: #155724;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.calendar-day.intensity-2 {
    background: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 100%);
    border-color: #20c997;
    color: #0c5460;
    box-shadow: 0 2px 8px rgba(32, 201, 151, 0.3);
}

.calendar-day.intensity-3 {
    background: linear-gradient(135deg, #7fcdcd 0%, #74b9ff 100%);
    border-color: #007bff;
    color: #004085;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

.calendar-day.intensity-4 {
    background: linear-gradient(135deg, #74b9ff 0%, #6c5ce7 100%);
    border-color: #6f42c1;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.5);
}

.calendar-day::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-day:hover::before {
    opacity: 1;
}

/* 添加学习活跃度图例 */
.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.legend-color.level-0 { background: #ffffff; }
.legend-color.level-1 { background: linear-gradient(135deg, #c3f0ca 0%, #a8e6cf 100%); }
.legend-color.level-2 { background: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 100%); }
.legend-color.level-3 { background: linear-gradient(135deg, #7fcdcd 0%, #74b9ff 100%); }
.legend-color.level-4 { background: linear-gradient(135deg, #74b9ff 0%, #6c5ce7 100%); }

/* 日历动画效果 */
.calendar-day-animate {
    animation: fadeInScale 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0.8);
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 今天的特殊样式 */
.calendar-day.today {
    border: 2px solid #ff6b6b !important;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
    font-weight: bold;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    }
    100% {
        box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
    }
}

/* 周末的特殊样式 */
.calendar-day.weekend {
    background-color: #fff8e1;
    border-color: #ffcc02;
}

.calendar-day.weekend:not([class*="intensity-"]):not(.intensity-1):not(.intensity-2):not(.intensity-3):not(.intensity-4) {
    color: #f57c00;
}

/* 🎯 让科目分布卡片与学习趋势卡片等高 */
.col-lg-4 .chart-card {
    height: 400px; /* 设置固定高度与学习趋势卡片匹配 */
    padding: 1.5rem; /* 减少内边距 */
    display: flex;
    flex-direction: column;
}

.col-lg-4 .chart-card h5 {
    margin-bottom: 1rem;
    flex-shrink: 0; /* 标题不收缩 */
}

.col-lg-4 .chart-card canvas {
    flex: 1; /* canvas占据剩余空间 */
    max-height: 300px; /* 限制canvas最大高度 */
    width: 100% !important;
    height: auto !important;
}

/* 确保学习趋势卡片也有相同高度 */
.col-lg-8 .chart-card {
    height: 400px; /* 确保学习趋势卡片高度一致 */
    display: flex;
    flex-direction: column;
}

.col-lg-8 .chart-card h5 {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.col-lg-8 .chart-card canvas {
    flex: 1;
    width: 100% !important;
    height: auto !important;
}

/* 错题卡片样式 */
.wrong-question-card {
    transition: all 0.3s ease;
    border-width: 2px !important;
}

.wrong-question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.wrong-question-card .card-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.wrong-question-card .question-content {
    background: rgba(0,123,255,0.02);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.wrong-question-card .answer-comparison {
    background: rgba(248,249,250,0.8);
    padding: 10px;
    border-radius: 6px;
}

.wrong-question-card .card-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 10px 15px;
}

.wrong-question-card .btn-sm {
    padding: 5px 12px;
    font-size: 0.875rem;
}

/* 优先级徽章动画 */
.badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.badge.bg-danger {
    animation-duration: 1.5s;
}

.badge.bg-warning {
    animation-duration: 2s;
}

.badge.bg-secondary {
    animation: none;
}

/* 科目分类装饰线颜色 */
.subject-progress[data-category="基础科目"] {
    border-left-color: #007bff;
}

.subject-progress[data-category="理科"] {
    border-left-color: #28a745;
}

.subject-progress[data-category="文科"] {
    border-left-color: #dc3545;
}

/* 日历信息样式 */
.calendar-info {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 0.8rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 响应式设计 - 大屏幕优化 */
@media (min-width: 1200px) {
    .calendar-heatmap {
        height: 320px; /* 大屏幕更高 */
        padding: 2rem;
    }
    
    .calendar-day {
        min-width: 20px;
        min-height: 20px;
        font-size: 0.75rem;
    }
}

/* 响应式设计 - 中等屏幕 */
@media (max-width: 992px) {
    .calendar-heatmap {
        height: 240px;
        padding: 1rem;
        gap: 1px;
    }
    
    .calendar-day {
        min-width: 14px;
        min-height: 14px;
        font-size: 0.6rem;
        border-radius: 3px;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 768px) {
    .calendar-heatmap {
        height: 200px;
        padding: 0.5rem;
        gap: 1px;
    }
    
    .calendar-day {
        min-width: 12px;
        min-height: 12px;
        font-size: 0.5rem;
        border-radius: 2px;
    }
    
    /* 小屏幕上隐藏日期数字，只显示颜色 */
    .calendar-day {
        font-size: 0;
    }
}

/* 加载动画 */
.calendar-day {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.calendar-day.animate {
    opacity: 1;
    transform: scale(1);
}

/* 空格子样式 */
.calendar-day.empty {
    background: transparent !important;
    border: none !important;
    cursor: default;
    pointer-events: none;
}

.calendar-day.empty:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* 12个月视图特殊优化 */
.calendar-heatmap[style*="grid-template-columns: repeat(53, 1fr)"] {
    /* 12个月视图：7行×53列 = 371格 */
    height: 220px; /* 降低高度适应更多列 */
    gap: 1px; /* 更小的间距 */
    padding: 1rem; /* 减少内边距 */
}

.calendar-heatmap[style*="grid-template-columns: repeat(53, 1fr)"] .calendar-day {
    min-width: 10px; /* 更小的最小宽度 */
    min-height: 12px; /* 更小的最小高度 */
    font-size: 0.5rem; /* 更小的字体 */
    border-radius: 2px; /* 更小的圆角 */
}

/* 12个月视图在大屏幕上的优化 */
@media (min-width: 1400px) {
    .calendar-heatmap[style*="grid-template-columns: repeat(53, 1fr)"] {
        height: 280px; /* 大屏幕稍高一些 */
    }
    
    .calendar-heatmap[style*="grid-template-columns: repeat(53, 1fr)"] .calendar-day {
        min-width: 12px;
        min-height: 14px;
        font-size: 0.6rem;
    }
}

/* 12个月视图在小屏幕上隐藏数字，只显示颜色 */
@media (max-width: 1200px) {
    .calendar-heatmap[style*="grid-template-columns: repeat(53, 1fr)"] .calendar-day {
        font-size: 0; /* 隐藏数字 */
        min-width: 8px;
        min-height: 10px;
    }
}