/* style.css */
/* สไตล์ทั่วไป */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    padding-bottom: 50px;
}

/* สไตล์แบบฟอร์ม */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background-color: #0d6efd;
    color: white;
    padding: 15px 20px;
}

.card-body {
    padding: 25px;
}

/* สไตล์คำถามและตัวเลือก */
.dimension-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.dimension-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dimension-title {
    color: #0d6efd;
    margin-bottom: 20px;
    font-weight: 600;
}

.question-item {
    margin-bottom: 25px;
}

.question-item:last-child {
    margin-bottom: 0;
}

.question-text {
    font-weight: 500;
    margin-bottom: 15px;
}

/* สไตล์ตัวเลือกระดับความพึงพอใจ */
.rating-group {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.rating-item {
    flex: 1;
    margin: 5px;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    background-color: white;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    min-width: 100px;
}

.rating-item:hover {
    background-color: #e9ecef;
}

.form-check-input:checked + .form-check-label {
    font-weight: bold;
}

/* สไตล์ตามระดับความพึงพอใจ */
#health-q1-5:checked + .form-check-label,
#health-q2-5:checked + .form-check-label,
#health-q3-5:checked + .form-check-label,
#education-q1-5:checked + .form-check-label,
#education-q2-5:checked + .form-check-label,
#environment-q1-5:checked + .form-check-label,
#environment-q2-5:checked + .form-check-label,
#environment-q3-5:checked + .form-check-label,
#social-culture-q1-5:checked + .form-check-label,
#social-culture-q2-5:checked + .form-check-label,
#economy-q1-5:checked + .form-check-label,
#economy-q2-5:checked + .form-check-label,
#management-q1-5:checked + .form-check-label,
#management-q2-5:checked + .form-check-label,
#overall-happiness-5:checked + .form-check-label {
    color: #28a745;
}

#health-q1-4:checked + .form-check-label,
#health-q2-4:checked + .form-check-label,
#health-q3-4:checked + .form-check-label,
#education-q1-4:checked + .form-check-label,
#education-q2-4:checked + .form-check-label,
#environment-q1-4:checked + .form-check-label,
#environment-q2-4:checked + .form-check-label,
#environment-q3-4:checked + .form-check-label,
#social-culture-q1-4:checked + .form-check-label,
#social-culture-q2-4:checked + .form-check-label,
#economy-q1-4:checked + .form-check-label,
#economy-q2-4:checked + .form-check-label,
#management-q1-4:checked + .form-check-label,
#management-q2-4:checked + .form-check-label,
#overall-happiness-4:checked + .form-check-label {
    color: #5cb85c;
}

#health-q1-3:checked + .form-check-label,
#health-q2-3:checked + .form-check-label,
#health-q3-3:checked + .form-check-label,
#education-q1-3:checked + .form-check-label,
#education-q2-3:checked + .form-check-label,
#environment-q1-3:checked + .form-check-label,
#environment-q2-3:checked + .form-check-label,
#environment-q3-3:checked + .form-check-label,
#social-culture-q1-3:checked + .form-check-label,
#social-culture-q2-3:checked + .form-check-label,
#economy-q1-3:checked + .form-check-label,
#economy-q2-3:checked + .form-check-label,
#management-q1-3:checked + .form-check-label,
#management-q2-3:checked + .form-check-label,
#overall-happiness-3:checked + .form-check-label {
    color: #ffc107;
}

#health-q1-2:checked + .form-check-label,
#health-q2-2:checked + .form-check-label,
#health-q3-2:checked + .form-check-label,
#education-q1-2:checked + .form-check-label,
#education-q2-2:checked + .form-check-label,
#environment-q1-2:checked + .form-check-label,
#environment-q2-2:checked + .form-check-label,
#environment-q3-2:checked + .form-check-label,
#social-culture-q1-2:checked + .form-check-label,
#social-culture-q2-2:checked + .form-check-label,
#economy-q1-2:checked + .form-check-label,
#economy-q2-2:checked + .form-check-label,
#management-q1-2:checked + .form-check-label,
#management-q2-2:checked + .form-check-label,
#overall-happiness-2:checked + .form-check-label {
    color: #fd7e14;
}

#health-q1-1:checked + .form-check-label,
#health-q2-1:checked + .form-check-label,
#health-q3-1:checked + .form-check-label,
#education-q1-1:checked + .form-check-label,
#education-q2-1:checked + .form-check-label,
#environment-q1-1:checked + .form-check-label,
#environment-q2-1:checked + .form-check-label,
#environment-q3-1:checked + .form-check-label,
#social-culture-q1-1:checked + .form-check-label,
#social-culture-q2-1:checked + .form-check-label,
#economy-q1-1:checked + .form-check-label,
#economy-q2-1:checked + .form-check-label,
#management-q1-1:checked + .form-check-label,
#management-q2-1:checked + .form-check-label,
#overall-happiness-1:checked + .form-check-label {
    color: #dc3545;
}

/* เพิ่มสไตล์สำหรับปุ่มเลือกระดับความพึงพอใจ */
.form-check-input[type="radio"]:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input[type="radio"]:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ปรับสไตล์กล่องเลือกโครงการ */
.form-select {
    padding: 10px;
    background-color: white;
}

.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* สไตล์หน้าแสดงผล */
.chart-container {
    position: relative;
    margin: auto;
}

/* สไตล์ตารางแสดงผล */
.table th {
    background-color: #f8f9fa;
}

/* สไตล์ปุ่ม */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    padding: 10px 20px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    padding: 10px 20px;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
    padding: 10px 20px;
    font-weight: 500;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* สไตล์ส่วนกรองข้อมูล */
.filter-container {
    margin-bottom: 20px;
}

/* สไตล์หัวข้อหลัก */
h1 {
    font-weight: 700;
    color: #0d6efd;
}

.lead {
    color: #6c757d;
}

/* สไตล์ข้อมูลสรุป */
.display-4 {
    font-weight: 700;
    color: #0d6efd;
}

/* สไตล์ส่วนท้าย */
footer {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

/* สไตล์การแสดงผลบนอุปกรณ์ขนาดเล็ก */
@media (max-width: 767.98px) {
    .rating-group {
        flex-direction: column;
    }
    
    .rating-item {
        margin: 3px 0;
        min-width: auto;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* สไตล์สำหรับตัวกรองโครงการ */
#project-filter {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-title {
    margin: 0;
    font-weight: 600;
    color: #0d6efd;
}

/* สไตล์ตัวอักษรแสดงผลโดยรวม */
.happiness-score {
    font-size: 4rem;
    font-weight: bold;
    color: #0d6efd;
}

.happiness-score .text-muted {
    font-size: 2rem;
    font-weight: normal;
}

/* สไตล์สถิติเพิ่มเติม */
.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-title {
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stat-card .display-4 {
    font-size: 2.5rem;
    margin-bottom: 0;
}

/* สไตล์สำหรับหน้า thank you */
.thank-you-container {
    max-width: 600px;
    margin: 100px auto;
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.thank-you-container h1 {
    color: #0d6efd;
    margin-bottom: 20px;
}

.thank-you-container p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 18px;
}

/* สไตล์สำหรับกราฟในหน้าผลลัพธ์ */
.dimension-chart-container {
    height: 300px;
    margin-bottom: 20px;
}

/* สไตล์สำหรับไอคอนในหน้ารายงาน */
.dimension-icon {
    width: 48px;
    height: 48px;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.dimension-icon svg {
    color: #0d6efd;
}

/* สไตล์สำหรับตัวกรองโครงการในหน้ารายงาน */
.filter-section {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.filter-section h4 {
    color: #0d6efd;
    margin-bottom: 20px;
}

/* ปรับตัวเลือกระดับความพึงพอใจให้เด่นชัดยิ่งขึ้น */
.rating-item:hover {
    cursor: pointer;
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.rating-item .form-check-input:checked ~ .form-check-label {
    font-weight: bold;
}

/* ปรับสีพื้นหลังตามระดับความพึงพอใจเมื่อเลือก */
.rating-item:has(.form-check-input[value="5"]:checked) {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

.rating-item:has(.form-check-input[value="4"]:checked) {
    background-color: rgba(92, 184, 92, 0.1);
    border-color: #5cb85c;
}

.rating-item:has(.form-check-input[value="3"]:checked) {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.rating-item:has(.form-check-input[value="2"]:checked) {
    background-color: rgba(253, 126, 20, 0.1);
    border-color: #fd7e14;
}

.rating-item:has(.form-check-input[value="1"]:checked) {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

/* สไตล์สำหรับตัวชี้วัดความสุข */
.happiness-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.happiness-scale {
    display: flex;
    width: 100%;
    max-width: 500px;
    height: 10px;
    background: linear-gradient(to right, #dc3545, #ffc107, #28a745);
    border-radius: 5px;
    position: relative;
}

.happiness-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border: 2px solid #0d6efd;
    border-radius: 50%;
    top: -5px;
    transform: translateX(-50%);
}

/* สไตล์สำหรับตารางข้อมูลสรุป */
.summary-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.summary-table tr:hover {
    background-color: #f8f9fa;
}

/* สไตล์สำหรับปุ่มบันทึกกราฟ */
.save-chart {
    font-size: 0.9rem;
    padding: 5px 10px;
}

/* สไตล์สำหรับแจ้งเตือนไม่มีข้อมูล */
#no-data {
    text-align: center;
    padding: 50px 0;
}