/* Dashboard CSS Styles */

/* General Container Styling */
.mtd-dashboard .container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Base Chart Section Styles */
.charts-section {
    display: flex;
    gap: 25px;
    margin-bottom: 25px; /* کاهش فاصله بین سطرها */
    flex-wrap: wrap; 
    /* در دسکتاپ، این فلکس برای سطر پایین فعال است و ساید بای ساید نمایش می‌دهد. */
}
.chart-card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* **تنظیمات مخصوص سطر بالا (نمودار دایره‌ای)** */
.top-charts-row .chart-card {
    flex: 1 1 100%; /* نمودار دایره‌ای تمام عرض را اشغال کند */
}

/* **تنظیمات مخصوص سطر پایین (نمودارهای میله‌ای)** */
.bottom-charts-row .chart-card {
    /* تقسیم سطر به دو ستون مساوی */
    flex: 1 1 calc(50% - 13px); /* 50% عرض منهای نصف فاصله گپ */
    min-width: 45%; /* برای اطمینان از کنار هم ماندن در عرض‌های متوسط */
}


/* 1. Top Stat Cards (KPIs) */
/* تغییر نام کانتینر از kpi-cards-container به kpi-section که در PHP استفاده شده است */
.kpi-section { 
    display: flex;
    gap: 25px;
    justify-content: space-between;
    margin-bottom: 50px;
    flex-wrap: wrap; 
}
.kpi-card {
    flex: 1;
    min-width: 250px;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
    border-right: 5px solid; 
}
.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.kpi-card .number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}
.kpi-card .label {
    font-size: 1.1em;
    color: #6c757d;
}

/* 2. Featured Cases Section */
.featured-cases-container {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 50px;
}
.case-card {
    flex: 1;
    min-width: 300px;
    background-color: #f8f9fa; 
    border-right: 5px solid #28aa45; 
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}
.case-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.case-card h4 {
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}
.case-card .case-category {
    font-size: 0.9em;
    color: #007bff; 
    display: block;
    margin-bottom: 15px;
}
.case-card .case-result {
    font-weight: bold;
    color: #28a745;
}
.case-card a { 
    display: inline-block;
    margin-top: 15px;
    padding: 5px 10px;
    background-color: #e9ecef;
    color: #007bff;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}
.case-card a:hover {
    background-color: #dee2e6;
}


/* Responsiveness adjustments for Mobile (فعال شدن طرح‌بندی عمودی زیر 768px) */
@media (max-width: 768px) {
    /* KPI Section */
    .kpi-section {
        flex-direction: column;
        gap: 15px;
    }
    .kpi-card {
        min-width: 100%;
    }
    
    /* Chart Section - Stacked vertically */
    .charts-section {
        flex-direction: column;
        gap: 20px;
    }
    .chart-card {
        min-width: 100%; 
        flex: 1 1 100%; 
        /* تعیین یک ارتفاع ثابت برای همه کارت‌ها در موبایل */
        height: 350px; 
    }
    
    /* تخصیص ارتفاع حداکثری به نمودار دایره‌ای برای اشغال فضای بیشتر */
    #topicChart {
        max-height: 300px; 
        margin: 0 auto;
        display: block;
    }

    /* Featured Cases */
    .featured-cases-container {
        flex-direction: column;
        gap: 15px;
    }
    .case-card {
        min-width: 100%;
    }
}