/**
 * EGP Statistics CSS
 */

/* ฟอนต์สำหรับภาษาไทย */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600;700&display=swap');

/* กำหนดรูปแบบทั่วไป */
.egp-statistics-container {
    font-family: 'Sarabun', sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    color: #222;
    position: relative;
}

/* Filters */
.egp-filters {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.egp-filters h2 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 10px;
}

.egp-filter-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    justify-content: space-between;
    gap: 15px;
}

.egp-filter-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 10px;
}

.egp-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.egp-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
}

.egp-button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 25px;
}

.egp-button:hover {
    background-color: #1e40af;
}

/* Chart Container */
.egp-chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 400px;
    position: relative;
}

/* Summary Container */
.egp-summary-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.egp-summary-container h3 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.egp-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.egp-summary-item {
    flex: 1;
    min-width: 200px;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.egp-summary-item h4 {
    color: #2563eb;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.egp-total {
    background-color: #e6f0ff;
    border-left: 4px solid #2563eb;
}

.egp-number {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 5px 0;
}

.egp-method-item {
    margin-bottom: 5px;
}

.egp-method-name {
    font-weight: 500;
}

/* Table Container */
.egp-table-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.egp-table-container h3 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.egp-table-wrapper {
    overflow-x: auto;
}

.egp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.egp-table th {
    background-color: #2563eb;
    color: white;
    text-align: left;
    padding: 12px;
    font-weight: 600;
}

.egp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.egp-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.egp-table tr:hover {
    background-color: #e6f0ff;
}

.egp-table a {
    color: #2563eb;
    text-decoration: none;
}

.egp-table a:hover {
    text-decoration: underline;
}

.egp-table-note {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* Loading */
.egp-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.egp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* รองรับการแสดงผลบนอุปกรณ์มือถือ */
@media (max-width: 768px) {
    .egp-filter-group {
        min-width: 100%;
    }
    
    .egp-summary-item {
        min-width: 100%;
    }
    
    .egp-chart-container {
        height: 300px;
    }
    
    .egp-table th, .egp-table td {
        padding: 8px;
        font-size: 13px;
    }
}

/* สีสำหรับการแสดงข้อมูลตามวิธีจัดหา */
.egp-method-e-bidding { color: #2563eb; }
.egp-method-คัดเลือก { color: #f97316; }
.egp-method-เฉพาะเจาะจง { color: #10b981; }