/* ============================================
   統計頁面統一樣式
   Statistics Page Unified Styles
   ============================================ */

.statistics-page {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    min-height: 100vh;
}

/* ===== Hero 區塊 ===== */
.page-hero-stats {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 5rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero-stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23fff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero-stats .hero-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.page-hero-stats .hero-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.page-hero-stats .shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(14, 165, 233, 0.4);
    top: -100px;
    left: -50px;
}

.page-hero-stats .shape-2 {
    width: 200px;
    height: 200px;
    background: rgba(99, 102, 241, 0.4);
    top: 50%;
    right: 10%;
}

.page-hero-stats .shape-3 {
    width: 150px;
    height: 150px;
    background: rgba(16, 185, 129, 0.3);
    bottom: -50px;
    left: 30%;
}

.page-hero-stats .hero-content {
    position: relative;
    z-index: 1;
}

.page-hero-stats .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #38bdf8;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.page-hero-stats h1 {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.page-hero-stats p {
    color: #94a3b8;
    font-size: 1.125rem;
    margin: 0;
}

/* ===== 提示區塊 ===== */
.summary-alert,
.notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.summary-alert {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.summary-alert .alert-icon {
    color: #3b82f6;
    font-size: 1.25rem;
}

.summary-alert .alert-content {
    color: #1e40af;
}

.summary-alert .alert-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.notice-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.notice-banner .notice-icon {
    color: #f59e0b;
    font-size: 1.25rem;
}

.notice-banner .notice-content {
    color: #92400e;
}

.notice-banner .notice-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* ===== 操作區 ===== */
.action-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
    color: white;
}

/* ===== 區塊標題 ===== */
.section-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.section-header-inline h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.section-header-inline h2 i {
    color: #0ea5e9;
}

.school-count-badge {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* ===== 總覽網格 ===== */
.overview-section {
    margin-bottom: 3rem;
}

.overview-grid {
    display: grid;
    gap: 1.5rem;
}

.overview-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.overview-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.overview-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.overview-card.total::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.overview-card.pass::before,
.overview-card.a1::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.overview-card.rate::before,
.overview-card.a2::before {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.overview-card.a3::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.overview-icon-wrapper {
    margin-bottom: 0.5rem;
}

.overview-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 1.5rem;
}

.overview-card.total .overview-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.overview-card.pass .overview-icon,
.overview-card.a1 .overview-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.overview-card.rate .overview-icon,
.overview-card.a2 .overview-icon {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
}

.overview-card.a3 .overview-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.overview-data {
    display: flex;
    flex-direction: column;
}

.overview-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.overview-value small {
    font-size: 1.25rem;
    font-weight: 600;
}

.overview-label {
    font-size: 0.925rem;
    color: #64748b;
    margin-top: 0.375rem;
}

.overview-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.overview-progress .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

/* ===== 圖表區塊 ===== */
.charts-section {
    margin-bottom: 3rem;
}

.charts-grid {
    display: grid;
    gap: 1.5rem;
}

.charts-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.chart-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.chart-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.chart-badge.a1 {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.chart-badge.a2 {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.chart-badge.a3 {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.chart-badge.ipad {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.chart-wrapper {
    max-height: 280px;
    display: flex;
    justify-content: center;
}

/* ===== 未完成卡片 ===== */
.uncompleted-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.uncompleted-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #fee2e2;
}

.uncompleted-header i {
    color: #f59e0b;
    font-size: 1.25rem;
}

.uncompleted-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.count-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.uncompleted-list {
    max-height: 240px;
    overflow-y: auto;
}

.uncompleted-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

.uncompleted-item:last-child {
    border-bottom: none;
}

.uncompleted-item .school-name {
    font-size: 0.9rem;
    color: #374151;
}

.uncompleted-item .school-rate {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
}

/* ===== 學校統計網格 ===== */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.school-card {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.school-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

.school-card.complete {
    border-left: 4px solid #10b981;
}

.school-card.progress {
    border-left: 4px solid #f59e0b;
}

.school-card.low {
    border-left: 4px solid #ef4444;
}

.school-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.school-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    border-radius: 0.875rem;
    color: white;
    font-size: 1.25rem;
}

.school-info {
    flex: 1;
}

.school-card .school-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
}

.school-code {
    font-size: 0.8rem;
    color: #64748b;
}

.school-count {
    text-align: right;
}

.count-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.count-label {
    font-size: 0.75rem;
    color: #64748b;
}

.school-stats {
    padding: 1.25rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.stat-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.stat-value {
    font-weight: 700;
    color: #0f172a;
}

.progress-bar-modern {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin-bottom: 0;
    overflow: hidden;
}

.progress-bar-modern .progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.school-card.complete .progress-bar-modern .progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.school-card.progress .progress-bar-modern .progress-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.school-card.low .progress-bar-modern .progress-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.school-footer {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pass-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pass-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pass-dot.complete {
    background: #10b981;
}

.pass-dot.pending {
    background: #94a3b8;
}

.pass-label {
    font-size: 0.8rem;
    color: #64748b;
}

.pass-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
}

/* ===== 響應式設計 ===== */
@media (max-width: 1024px) {
    .overview-grid-3,
    .overview-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid-2 {
        grid-template-columns: 1fr;
    }

    .page-hero-stats h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .overview-grid-3,
    .overview-grid-4 {
        grid-template-columns: 1fr;
    }

    .schools-grid {
        grid-template-columns: 1fr;
    }

    .section-header-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-hero-stats {
        padding: 3rem 1.5rem;
    }

    .page-hero-stats h1 {
        font-size: 1.75rem;
    }
}
