/* --- General & Form Styles --- */
body { font-family: 'Tajawal', sans-serif; background-color: #e9e9e9; direction: rtl; color: #333; }
.container { max-width: 850px; margin: 20px auto; padding: 20px; background: #fdfdfd; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
h1 { text-align: center; color: #0056b3; font-weight: 700; }

.form-header-logo {
    text-align: center;
    margin-bottom: 20px;
}

.form-header-logo img {
    max-width: 150px;
    height: auto;
}

/* Form Styles */
button { padding: 12px 25px; border: none; background: #0056b3; color: white; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: 700; margin-top: 10px; }
#printButton { background: #28a745; }

/* --- Report Styles --- */
.report-output { display: none; padding: 20px; margin-top: 20px; background: #fff; border: 1px solid #ddd; }
.report-header { text-align: center; margin-bottom: 15px; }
.report-header img { height: 60px; }
.report-header h2 { font-size: 16px; margin: 2px 0; font-weight: normal; color: #555; }

.report-title {
    background-color: #004a99;
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 15px 0;
}

.report-body { padding: 10px 0; }

.report-block {
    border: 1px solid #dcdcdc;
    border-top: 4px solid #1abc9c; /* The green/turquoise border */
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden; /* To contain the child elements */
}

.block-title {
    background-color: #34495e; /* Dark blue/grey background for title */
    color: white;
    padding: 10px 15px;
    font-size: 18px;
    font-weight: 700;
}

.block-content { padding: 15px; }

/* Styling for different content types */
.info-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.info-row:last-child { border-bottom: none; }
.info-label { font-weight: 700; color: #34495e; flex-basis: 30%; }
.info-value { flex-basis: 70%; }

.block-content ul { list-style-type: none; padding-right: 0; margin: 0; }
.block-content li { padding: 8px 5px; border-bottom: 1px dotted #ccc; }
.block-content li:last-child { border-bottom: none; }

.report-images { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 10px; }
.evidence-image-container { text-align: center; font-weight: bold; color: #555; }
.evidence-image-container p { margin-bottom: 8px; }
.evidence-image-container img { max-width: 220px; max-height: 220px; border: 3px solid #eee; border-radius: 8px; padding: 3px; }

/* --- Footer --- */
.report-footer { display: flex; justify-content: space-around; text-align: center; margin-top: 30px; padding-top: 20px; border-top: 2px solid #f0f0f0; }
.signature { display: flex; flex-direction: column; align-items: center; }
.signature strong { font-size: 16px; margin-bottom: 45px; }

.page-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #777;
}
.page-footer p { margin: 5px 0; }
.page-footer a { color: #0056b3; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* --- Print Styles --- */
@media print {
    /* General page setup for printing */
    body {
        background: #fff;
        margin: 0;
        padding: 0;
        font-size: 9.5pt; /* Slightly smaller base font */
        line-height: 1.3; /* Tighter line spacing */
    }

    /* Hide form, titles, and buttons */
    #strategyForm, #printButton, h1, .container > h1, .container > form, .container > button, .page-footer, .form-header-logo {
        display: none;
    }

    /* Make report take up the whole space */
    .container, .report-output {
        display: block !important;
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    .report-output {
        padding: 1cm; /* Reduced A4 margins */
        box-sizing: border-box;
    }

    /* Reduce spacing and font sizes */
    .report-header { margin-bottom: 8px; padding-bottom: 8px; }
    .report-header img { height: 40px; }
    .report-header h2 { font-size: 11pt; margin: 1px 0; }

    .report-title {
        font-size: 15pt;
        padding: 7px;
        margin: 8px 0;
        -webkit-print-color-adjust: exact; 
        color-adjust: exact;
    }

    .report-block {
        margin-bottom: 6px; /* Reduced space between blocks */
        page-break-inside: avoid; 
        border-top-width: 3px;
    }

    .block-title {
        font-size: 11pt;
        padding: 5px 10px;
        -webkit-print-color-adjust: exact; 
        color-adjust: exact;
    }

    .block-content { padding: 6px 10px; }
    .info-row { padding: 3px 0; }
    .info-label, .info-value { font-size: 9pt; }
    .block-content li { padding: 2px 5px; font-size: 9pt; }

    .report-images { padding: 5px; gap: 8px; }
    .evidence-image-container img {
        max-width: 140px; 
        max-height: 100px; /* Reduced image height */
    }

    .report-footer { margin-top: 15px; padding-top: 10px; }
    .signature strong { font-size: 10pt; margin-bottom: 15px; /* Significantly reduced space */ }
    .signature p { font-size: 9pt; }
}
