/* --- General Styles & Font --- */
body {
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #007bff;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

h2 {
    margin-top: 30px;
}

/* --- Header Summary Section --- */
.project-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-box {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
}

.budget-info .box-title {
    font-size: 14px;
    color: #6c757d;
}

.budget-info .main-amount {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
    margin: 5px 0;
}

.budget-info .budget-details {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
}

.progress-info label {
    display: block;
    margin-bottom: 15px;
    color: #6c757d;
    font-weight: 500;
}

.progress-bar-container {
    background-color: #e9ecef;
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}

#overall-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #007bff;
    border-radius: 20px;
    transition: width 0.4s ease;
}


/* --- Phase Card --- */
.phase-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden; /* To keep border-radius working with the header */
}

.phase-card.active {
    border: 1px solid #ffc107;
}

.phase-header {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.phase-progress-container {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 0 15px;
}

.phase-progress-bar {
    height: 100%;
    width: 0%; /* Will be updated by JS */
    background-color: #fff;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.status-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0; /* Prevents tag from shrinking */
}

.status-tag.in-progress {
    background-color: #ffc107;
    color: #333;
}

.status-tag.soon {
    background-color: #6c757d;
    color: white;
}

.phase-content {
    display: flex;
    padding: 15px;
    background-color: #fff;
}

/* --- Payment & Features inside card --- */
.payment-details {
    flex: 1;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-left: 15px; /* Margin for RTL layout */
}

.payment-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.payment-details p {
    margin: 5px 0;
    font-size: 14px;
}

.payment-btn {
    border: 1px solid #ced4da;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    margin-top: 10px;
}

.payment-btn:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.features-list {
    flex: 3;
    padding-right: 15px;
}

.features-list h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.features-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 5px 0;
}

.features-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.features-list input[type="checkbox"] {
    margin-left: 10px;
    width: 16px;
    height: 16px;
}
/* --- Status Tag Styles --- */
.phase-status {
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    flex-shrink: 0; /* Prevents tag from shrinking */
    transition: background-color 0.3s ease;
    min-width: 80px; /* Gives it a consistent width */
    text-align: center;
}

.status-soon {
    background-color: #6c757d; /* Gray */
}

.status-in-progress {
    background-color: #ffc107; /* Yellow */
    color: #333;
}

.status-completed {
    background-color: #28a745; /* Green */
}
/* --- Positioning for Percentage Text --- */
.phase-progress-container {
    /* Add position relative to act as a container for the absolute text */
    position: relative; 
    display: flex;
    align-items: center;
}

.phase-percentage-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #333; /* Dark color to be visible on both backgrounds */
    z-index: 2; /* Ensure text is above the progress bar */
    /* Prevent user from selecting the text */
    user-select: none; 
}
/* --- Style for the paid button --- */
.payment-btn.paid {
    background-color: #28a745; /* Green color */
    color: white;
    border-color: #28a745;
    cursor: default; /* Change cursor to show it's no longer clickable */
}



/* --- Positioning for Overall Progress Text --- */

/* Ensure the container can position its children absolutely */
.progress-info .progress-bar-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Style the text itself */
#overall-percentage-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: white; /* White color to be visible on the blue bar */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Shadow for readability */
    z-index: 2; /* Ensure text is above the progress bar */
    user-select: none;
}