/* General Dashboard Styles */
.project-dashboard {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #343a40; /* Darker text for professionalism */
    background-color: #f4f7f6; /* Slightly softer background */
    padding: 20px; /* Reduced padding */
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); /* Slightly more prominent shadow */
}

.project-dashboard h1 {
    font-size: 2em; /* Slightly smaller h1 */
    color: #212529; /* Darker heading for contrast */
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 12px; /* Reduced padding */
    font-weight: 600;
}

.project-dashboard h2 {
    font-size: 1.6em; /* Slightly smaller h2 */
    color: #343a40;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Card Section Layout */
.card-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Reduced gap */
    margin-bottom: 20px; /* Reduced margin */
}

/* Card Styles */
.card {
    background-color: #ffffff;
    border-radius: 8px; /* Slightly smaller border-radius */
    border: 1px solid #e0e0e0; /* Added subtle border */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); /* Softer shadow */
    padding: 18px; /* Reduced padding */
    flex: 1;
    min-width: 200px; /* Reduced min-width */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Subtle hover effect */
}

.card:hover {
    transform: translateY(-3px); /* Slightly less lift */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); /* Slightly stronger shadow on hover */
}

.card h3 {
    color: #007bff; /* Primary blue for sub-headings */
    font-size: 1.15em; /* Reduced font size */
    margin-top: 0;
    margin-bottom: 12px; /* Reduced margin */
    padding-bottom: 6px; /* Reduced padding */
    border-bottom: 1px solid #f8f9fa; /* Lighter border for h3 */
    font-weight: 600;
}

.card p {
    margin: 5px 0; /* Reduced margin */
    font-size: 0.9em; /* Reduced font size */
    color: #495057; /* Slightly darker paragraph text */
}

/* Large Indicator Card */
.large-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.large-indicator .indicator-value {
    font-size: 3em; /* Reduced font size */
    font-weight: 700;
    margin-top: 10px; /* Reduced margin */
    line-height: 1;
}

/* Semantic Colors for Indicators */
.progress-green { color: #28a745; } /* Vert pour succès/positif */
.text-red { color: #dc3545; }     /* Rouge pour retard/problème critique */
.text-orange { color: #fd7e14; }  /* Orange légèrement ajusté pour l'avertissement */

/* Separator */
.separator {
    border: 0;
    height: 1px; /* Thinner separator */
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin: 35px 0; /* Reduced margin */
}

/* Grid for Project Health Indicators */
.grid-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Reduced min-width */
    gap: 15px; /* Reduced gap */
    margin-bottom: 30px; /* Reduced margin */
}

.grid-indicators .indicator-item {
    text-align: center;
    padding: 15px; /* Reduced padding */
}

.grid-indicators .indicator-item p:first-child {
    font-size: 0.9em; /* Reduced font size */
    color: #6c757d; /* Neutral gray for labels */
    margin-bottom: 3px; /* Reduced margin */
}

.grid-indicators .indicator-item .indicator-value {
    font-size: 1.7em; /* Reduced font size */
    font-weight: 700;
    margin-top: 5px; /* Reduced margin */
}

/* Chart Section Layout */
.chart-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Reduced min-width */
    gap: 15px; /* Reduced gap */
    margin-bottom: 30px; /* Reduced margin */
}

/* Progress Bar Chart (ÉCART DÉLAIS) */
.progress-bar-container {
    background-color: #e9ecef;
    border-radius: 4px; /* Slightly smaller border-radius */
    height: 18px; /* Reduced height */
    margin-top: 15px; /* Reduced margin */
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    text-align: center;
    color: white;
    font-weight: bold;
    line-height: 18px; /* Adjusted line-height */
}

.progress-bar.delay { background-color: #ff922b; } /* Slightly softer orange */

.chart-label {
    text-align: right;
    font-size: 0.85em; /* Reduced font size */
    color: #6c757d;
    margin-top: 5px; /* Reduced margin */
}

/* Progression Phases Chart */
.progress-phases {
    margin-top: 15px; /* Reduced margin */
}

.progress-phases .phase {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0; /* Reduced padding */
    border-bottom: 1px dashed #e9ecef; /* Dashed border */
    font-size: 0.95em; /* Reduced font size */
    color: #495057;
}

.progress-phases .phase:last-child {
    border-bottom: none;
}

.progress-phases .phase span {
    font-weight: 600;
    color: #0056b3; /* Darker blue for emphasis */
}

/* Pie Chart (APERÇU DES STATUTS DES TÂCHES) */
.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px; /* Reduced margin */
}

.pie-chart {
    position: relative;
    width: 140px; /* Reduced size */
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        #dc3545 0% var(--late-percent, 0%),
        #ffc107 var(--late-percent, 0%) calc(var(--late-percent, 0%) + var(--risk-percent, 0%)),
        #28a745 calc(var(--late-percent, 0%) + var(--risk-percent, 0%)) calc(var(--late-percent, 0%) + var(--risk-percent, 0%) + var(--completed-percent, 0%))
    );
    margin-bottom: 20px; /* Reduced margin */
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.8), 0 2px 5px rgba(0,0,0,0.1); /* Added outer shadow for more style */
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced gap */
    font-size: 0.9em; /* Reduced font size */
}

.pie-legend div {
    display: flex;
    align-items: center;
}

.pie-legend .legend-color {
    width: 15px; /* Reduced size */
    height: 15px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Bottom Navigation Bar */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 15px 0; /* Reduced padding */
    background-color: #e9ecef;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px; /* Smaller border-radius */
    margin-top: 30px; /* Reduced margin */
    box-shadow: 0 -1px 5px rgba(0,0,0,0.03); /* Softer shadow upwards */
}

.bottom-nav .nav-button {
    background: none;
    border: none;
    color: #007bff;
    font-size: 1em; /* Reduced font size */
    padding: 10px 15px; /* Reduced padding */
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    font-weight: 500;
}

.bottom-nav .nav-button:hover {
    background-color: #e0f0ff; /* Lighter hover background */
    color: #0056b3;
}

.bottom-nav .nav-button.active {
    background-color: #0056b3; /* Darker blue active state */
    color: white;
    font-weight: 600; /* Slightly less bold active text */
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.3); /* Softer shadow for active */
    transform: translateY(-1px); /* Slightly less lift */
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-section, .chart-section, .grid-indicators {
        flex-direction: column;
        display: flex;
    }

    .card {
        min-width: unset;
        width: 100%;
    }

    .project-dashboard h1 {
        font-size: 1.6em; /* Further reduced for mobile */
    }

    .large-indicator .indicator-value {
        font-size: 2.5em; /* Further reduced for mobile */
    }

    .bottom-nav {
        flex-wrap: wrap;
        padding: 10px; /* Reduced padding */
        gap: 5px; /* Reduced gap */
    }

    .bottom-nav .nav-button {
        flex: 1 1 auto;
        margin: 2px;
        font-size: 0.85em; /* Further reduced for mobile */
        padding: 8px 10px;
    }
}

/* JavaScript dependent styles for pie chart */
.pie-chart {
    --late-percent: 0%;
    --risk-percent: 0%;
    --completed-percent: 0%;
}
