/*
    CSS สำหรับการออกแบบเว็บไซต์ที่ดูทันสมัยและสะอาดตา
    - ใช้ Flexbox สำหรับ Layout
    - ใช้ฟอนต์ Sarabun เพื่อความอ่านง่าย
    - ใช้สีและเงาที่นุ่มนวล
    - ออกแบบให้ตอบสนอง (Responsive)
*/

/* 1. Reset และตั้งค่าพื้นฐาน */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6; /* สีพื้นหลังอ่อนๆ */
    color: #333;
}

#container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* เงาที่ดูนุ่มนวล */
}

/* 2. ส่วนหัว (Header) */
#header {
    background-color: #4CAF50; /* สีเขียวสดใส */
    color: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

#header h1 {
    font-size: 2.5em;
    font-weight: 700;
}

/* 3. ข้อความประกาศ (Announcement/Marquee replacement) */
#announcement {
    background-color: #e0f2f1; /* สีเขียวอ่อนมาก */
    color: #00796B; /* สีเขียวเข้มสำหรับข้อความ */
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 600;
}

/* 4. Layout หลัก (Flexbox) */
#main-layout {
    display: flex;
    flex-direction: row; /* เริ่มต้นเป็นแนวนอน */
    gap: 20px; /* ระยะห่างระหว่าง Sidebar และ Content */
}

/* 5. เมนูด้านซ้าย (Sidebar/Navigation) */
#sidebar {
    flex: 0 0 250px; /* กำหนดความกว้างเริ่มต้น 250px */
}

.menu-list {
    list-style: none;
    padding: 0;
}

.menu-list li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s, color 0.3s;
    font-weight: 500;
}

.menu-list li:last-child a {
    border-bottom: none;
}

.menu-list li a:hover {
    background-color: #4CAF50;
    color: white;
    border-radius: 0 0 5px 5px; /* ทำให้ดูทันสมัยขึ้นเมื่อโฮเวอร์ */
}

/* 6. เนื้อหาด้านขวา (Content Area) */
#content-area {
    flex-grow: 1; /* ขยายเพื่อเติมเต็มพื้นที่ที่เหลือ */
}

/* 7. Card Component (ใช้แทน Box เดิม) */
.card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header, .card-title {
    background-color: #5CB85C; /* สีเขียวเข้มสำหรับหัวข้อ */
    color: white;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 700;
}

.menu-card .card-header {
    background-color: #00796B; /* สีเขียวอมน้ำเงินสำหรับเมนู */
}

.card-body {
    padding: 20px;
}

/* Iframe */
.card-body iframe {
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 8. ส่วนท้าย (Footer) */
#footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-radius: 0 0 8px 8px;
    font-size: 0.9em;
}

#footer p {
    margin: 5px 0;
}

/* 9. Responsive Design สำหรับหน้าจอขนาดเล็ก (Mobile First) */
@media (max-width: 768px) {
    #container {
        padding: 10px;
    }

    #main-layout {
        flex-direction: column; /* เปลี่ยนเป็นเรียงซ้อนกันในแนวนอน */
    }

    #sidebar {
        flex: 1 1 auto; /* ให้ Sidebar ใช้พื้นที่เต็มความกว้าง */
        order: -1; /* ย้ายเมนูไปอยู่ด้านบน (Optional) */
        margin-bottom: 10px;
    }

    .menu-list {
        display: flex; /* ทำให้รายการเมนูเรียงเป็นแถวในแนวนอน (หรือแนวนอนเมื่อมีพื้นที่จำกัด) */
        flex-wrap: wrap;
        border-top: 1px solid #eee;
    }
    
    .menu-list li {
        flex: 1 1 50%; /* ให้เมนูแสดง 2 คอลัมน์บนมือถือ */
    }

    .menu-list li a {
        text-align: center;
        border-bottom: none;
        border-right: 1px solid #eee;
        padding: 10px 5px;
    }

    .menu-list li:nth-child(even) a {
        border-right: none;
    }
    
    .card-body iframe {
        height: 350px; /* ลดความสูงของ iframe บนมือถือ */
    }
}