
/* قواعد RTL الأساسية */
form-container, .results-container {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
h1 { color: #004a7c; }
h2 { margin-top: 0; color: #005a9c; }
h3 { margin-bottom: 20px; border-bottom: 2px solid #005a9c; padding-bottom: 10px; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input[type="number"] {
    width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc;
    border-radius: 4px; box-sizing: border-box;
}
button {
    width: 100%; padding: 12px; background-color: #007bff; color: white;
    border: none; border-radius: 4px; cursor: pointer; font-size: 16px;
    transition: background-color 0.2s;
}
button:hover { background-color: #0056b3; }
.chart-container { margin-top: 30px; }

#results-summary p {
    font-size: 1.1em; margin: 10px 0; border-bottom: 1px solid #eee;
    padding-bottom: 10px; display: flex; justify-content: space-between;
}
#results-summary span { font-weight: bold; color: #005a9c; }
.hidden { display: none; }
#loader { text-align: center; font-size: 1.2em; }
#error-message {
    color: #d9534f; background-color: #f2dede; border: 1px solid #ebccd1;
    padding: 15px; border-radius: 4px;
}
.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* Home page specific styles */
.home-main {
    display: block;
}
.nav-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}
.nav-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 300px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.nav-card h2 {
    color: #005a9c;
}

@media (max-width: 800px) {
    main { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; align-items: center; }
}




/* NEW: Add space between the input and output summaries */
#input-summary {
    margin-bottom: 30px;
}

/* MODIFIED: Target p tags in both summary divs */
#input-summary p, #output-summary p {
    font-size: 1.1em; 
    margin: 10px 0; 
    border-bottom: 1px solid #eee;
    padding-bottom: 10px; 
    display: flex; 
    justify-content: space-between;
}

/* MODIFIED: Target span tags in both summary divs */
#input-summary span, #output-summary span { 
    font-weight: bold; 
    color: #005a9c; 
}



/* NEW and MODIFIED styles */

#input-summary p, #output-summary p {
    font-size: 1.1em; margin: 10px 0; border-bottom: 1px solid #eee;
    padding-bottom: 10px; display: flex; justify-content: space-between;
}
#input-summary span, #output-summary span { font-weight: bold; color: #005a9c; }


/* Add styles for new elements */
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
}

.checkbox-group {
    margin: 0 0 15px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    margin: 10px;
    width: auto; /* Override default width */
}

input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.form-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 15px 0;
}


/* --- UPDATED & NEW STYLES for Results Organization --- */

/* Add margin between the summary sections */
#input-summary, #output-kpis, #output-details {
    margin-bottom: 30px;
}


/* Target all summary paragraphs */
.results-container p {
    font-size: 1.0em; /* Slightly smaller for more data */
    margin: 8px 0; 
    border-bottom: 1px solid #eee;
    padding-bottom: 8px; 
    display: flex; 
    justify-content: space-between;
}
.results-container span { 
    font-weight: bold; 
    color: #005a9c; 
    text-align: right;
    padding-left: 10px;
}




/* Add this to your main CSS file */
.chart-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    /* --- FIX: Set a defined height --- */
    height: 300px; /* Adjust this value as needed */
    /* ---------------------------------- */
}


/* Charts Grid Layout */
.charts-wrapper {
 
    margin-top: 20px;
}



/* REMOVED the special rule for the on-grid page */
/* Now the grid will be 2x2 by default if there are more than 2 charts */


@media (max-width: 900px) {
    /* Stack charts on smaller screens */
    .charts-wrapper {
        grid-template-columns: 1fr;
    }
}


/* Container for the radio buttons */
.radio-group {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 20px; /* Space between radio options */
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px; /* Space below the group */
}

/* Individual label for each radio button */
.radio-group label {
    font-weight: normal; /* Make the label text normal weight */
    color: #333;
    cursor: pointer;
    display: inline-flex; /* Align radio button and text */
    align-items: center;
    margin-bottom: 0; /* Override default label margin */
}

/* The radio button itself */
.radio-group input[type="radio"] {
    /* Place radio button to the right of the text in RTL */
    margin-left: 8px; 
    /* Larger, more clickable radio buttons */
    width: 1.15em;
    height: 1.15em;
    accent-color: #007bff; /* Modern way to color radio/checkboxes */
}
