/* Report Page Styles */
#detailed-report-page {
    font-family: 'Inter', sans-serif;
    color: #333;
    padding: 20px 0;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

/* Header */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.report-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.report-date {
    color: #888;
    font-size: 0.95rem;
}

/* User Card */
.report-user-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.report-user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary-color);
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: #e0f2fe;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    margin-right: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.user-info {
    flex-grow: 1;
}

.user-info h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #2c3e50;
    font-weight: 800;
}

.user-info p {
    margin: 5px 0 0;
    color: #64748b;
    font-weight: 500;
}

.total-score-box {
    text-align: center;
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 16px;
    box-shadow: 0 8px 15px rgba(26, 95, 122, 0.3);
}

.score-val {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

.score-lbl {
    font-size: 0.8rem;
    opacity: 0.9;
    letter-spacing: 1px;
}

/* Stats Grid */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

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

.stat-card .icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
}

.stat-card .val {
    font-size: 1.6rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 5px;
}

.stat-card .lbl {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
}

.stat-card.correct .val {
    color: #10b981;
}

.stat-card.wrong .val {
    color: #ef4444;
}

.stat-card.empty .val {
    color: #f59e0b;
}

.stat-card.time .val {
    color: #3b82f6;
}

.stat-card.speed .val {
    color: #8b5cf6;
}

/* Analysis Box */
.report-analysis-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.report-analysis-box h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.3rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.report-analysis-box p {
    color: #475569;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Actions */
.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .report-user-card {
        flex-direction: column;
        text-align: center;
    }

    .user-avatar {
        margin: 0 0 15px 0;
    }

    .user-info {
        margin-bottom: 20px;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions button {
        width: 100%;
    }
}

/* Print Styles */
@media print {

    /* Genel Sıfırlama */
    body * {
        visibility: hidden;
        /* Her şeyi gizle */
        overflow: visible !important;
    }

    /* Sadece Rapor Kartını Göster */
    #math-exam-container,
    #math-exam-container * {
        visibility: visible;
    }

    /* Rapor Kartını Sayfaya Yerleştir */
    #math-exam-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
        z-index: 9999;
    }

    .exam-card {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        /* Scroll'u kaldır */
        box-shadow: none !important;
        border: none !important;
        padding: 20px !important;
        position: static !important;
        /* Absolute yerine static, akışa uysun */
        overflow: visible !important;
    }

    /* İçerik Scroll'unu Kaldır */
    .exam-card>div {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Gereksiz Butonları Gizle */
    .control-panel,
    .close-btn,
    #btn-close {
        display: none !important;
    }

    /* Sayfa Kırılımlarını Yönet (Kartlar Bölünmesin) */
    .exam-card>div>div {
        break-inside: avoid;
        page-break-inside: avoid;
        break-before: auto;
        margin-bottom: 20px;
    }

    /* Kondisyon Analizi (Grafik) Bölünmesi Sorunu */
    /* Grafiğin bulunduğu kartı bir arada tut */
    .exam-card canvas {
        max-height: 100%;
        /* Sığsın */
    }

    /* Eğer grafik sayfa sonuna geliyorsa yeni sayfaya at */
    .exam-card>div>div:last-child {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}