/* General Styles */
body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    color: #003366;
}

/* --- Header & Navigation --- */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-placeholder {
    font-size: 1.5rem;
    font-weight: 700;
    color: #003366;
}

/* Navigation Menu */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    position: relative; /* สำคัญสำหรับเมนูย่อย */
}

nav a {
    display: block;
    text-decoration: none;
    color: #003366;
    font-weight: 500;
    padding: 20px 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav > ul > li > a:hover {
    background-color: #f0f0f0;
    color: #0056b3;
}

/* Dropdown Sub-menu */
.dropdown-menu {
    display: none; /* ซ่อนเมนูย่อยไว้ก่อน */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 220px;
    border-radius: 0 0 5px 5px;
}

.dropdown-menu li a {
    padding: 12px 20px;
    color: #333;
    font-weight: 400;
    white-space: nowrap; /* ป้องกันข้อความขึ้นบรรทัดใหม่ */
}

.dropdown-menu li a:hover {
    background-color: #ffc72c;
    color: #003366;
}

/* แสดงเมนูย่อยเมื่อ hover ที่ li หลัก */
nav li:hover > .dropdown-menu {
    display: block;
}

/* --- Hero Slider Section --- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 500px; 
    overflow: hidden; 
    background-color: #e9ecef; 
}

.slides-container {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out; 
}

.slide {
    min-width: 100%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white; 
    position: relative; 
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    z-index: 1;
}

.slide-content {
    position: relative; 
    z-index: 2;
    padding: 20px 40px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.slide-content h1 {
    font-size: 3.5rem;
    margin: 0;
    color: #fff; 
}

.slide-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-top: 10px;
    color: #fff; 
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10; 
    transition: background-color 0.3s ease;
}

.slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

/* --- MSU for All Section --- */
.msu-for-all {
    background-color: #ffc72c;
    padding: 50px 0;
}

.msu-for-all .container-box {
    display: flex;
    align-items: center;
    gap: 30px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.msu-for-all .image-placeholder {
    flex-basis: 50%;
    min-height: 300px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.2rem;
}

.msu-for-all .text-container {
    flex-basis: 50%;
    padding: 40px;
}

/* --- News Section --- */
.news-section {
    padding: 60px 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.news-card .image-placeholder {
    height: 200px;
    background-color: #e9ecef; 
    display: flex; 
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    overflow: hidden; 
    position: relative; 
}

.news-card .image-placeholder img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    position: absolute; 
    top: 0;
    left: 0;
}

.news-card .image-placeholder span {
    position: relative; 
    z-index: 1; 
}
.news-card .image-placeholder img + span {
    display: none; 
}

.news-card-content {
    padding: 20px;
}

.news-card-content h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.news-card-content p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

.read-more-btn {
    display: inline-block;
    margin-top: 15px;
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

/* --- Footer --- */
footer {
    background-color: #003366;
    color: white;
    padding: 40px 0 20px 0;
    margin-top: 40px; /* เพิ่ม margin-top ให้ footer */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffc72c;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #004a8d;
    padding-top: 20px;
    font-size: 0.9rem;
}


/* ================================================== */
/* == CSS สำหรับหน้าบุคลากร, กรรมการ, ผู้บริหาร == */
/* ================================================== */

/* ==================================================
  == ส่วนที่ขาดหายไป (1): สไตล์การ์ดบุคลากร (Card) ==
  ==================================================
  (คลาสเหล่านี้ถูกใช้ใน management.html, board.html, และ staff.html)
*/

.team-member-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.team-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.team-member-card img {
    width: 100%;
    height: 400px; /* คุณสามารถปรับความสูงนี้ได้ */
    object-fit: cover; 
    object-position: top center; 
    display: block;
    background-color: #e9ecef; 
}

.member-info {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
}

.member-info h3 {
    font-size: 1.5rem;
    font-weight: 700; 
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #003366; 
}

.member-info p {
    font-size: 1rem;
    margin: 0.4rem 0;
    line-height: 1.6;
    color: #555;
}

.member-info p strong {
    font-weight: 500;
    color: #333;
}

.contact-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    text-align: left; 
}

.contact-info a {
    color: #0056b3; 
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}


/* ==================================================
  == ส่วนที่ขาดหายไป (2): Grid Layouts อื่นๆ ==
  ==================================================
  (คลาสเหล่านี้ถูกใช้ในหน้า management.html และ board.html)
*/

/* --- Grid 3 คอลัมน์ (สำหรับหน้าผู้บริหาร) --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem; 
}

/* --- Grid 1 คอลัมน์ กึ่งกลาง (สำหรับประธาน/เลขา) --- */
.team-grid-single-centered {
    grid-template-columns: minmax(320px, 400px);
    justify-content: center;
}


/* ================================================== */
/* == CSS ที่คุณส่งมา (ถูกต้องและทำงานได้ดี) == */
/* ================================================== */

/* --- Grid 4 คอลัมน์ (สำหรับหน้ากรรมการ/บุคลากร) --- */
.team-grid-4 {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .team-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .team-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* --- หัวข้อกลุ่มสาระ (หน้าบุคลากร) --- */
.department-title {
    font-size: 1.8rem; 
    font-weight: 600;
    color: #003366; 
    margin-top: 3rem;  
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #004a8d; 
    text-align: left; 
}

/* ================================================== */
/* == CSS (ปรับปรุงใหม่) สำหรับฟอร์มหน้าติดต่อ == */
/* ================================================== */

/* --- สไตล์ของฟอร์ม (เหมือนเดิม) --- */
.contact-form .form-group {
    margin-bottom: 1.25rem;
}

.contact-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

/* --- (ปรับปรุง) ช่องกรอกข้อมูล --- */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.85rem 1rem; /* เพิ่ม padding เล็กน้อย */
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    border: 1px solid #ddd; /* ทำให้เส้นขอบจางลง */
    border-radius: 8px;
    box-sizing: border-box; 
    background-color: #fdfdfd; /* สีพื้นหลังช่องกรอก */
    
    /* เพิ่ม transition */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- (เพิ่มใหม่) สไตล์เมื่อคลิก (Focus) --- */
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none; /* ลบเส้นขอบสีดำ/น้ำเงินเริ่มต้นของเบราว์เซอร์ */
    border-color: #0056b3; /* เปลี่ยนสีเส้นขอบเป็นสีธีม */
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1); /* เพิ่มเงา (Glow) */
}

.contact-form textarea {
    min-height: 150px;
}

/* --- (ปรับปรุง) ปุ่มส่งข้อความ --- */
.contact-form .submit-btn {
    width: 100%; /* ทำให้ปุ่มกว้างเต็ม */
    background-color: #003366; 
    color: white;
    font-family: 'Sarabun', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.9rem 1.5rem; /* เพิ่มความสูงปุ่ม */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    
    /* เพิ่มเงาและ transition */
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

/* --- (ปรับปรุง) เอฟเฟกต์เมื่อเมาส์ชี้ปุ่ม --- */
.contact-form .submit-btn:hover {
    background-color: #004a8d;
    box-shadow: 0 6px 12px rgba(0, 51, 102, 0.3); /* เพิ่มเงาเมื่อชี้ */
    transform: translateY(-2px); /* ขยับปุ่มขึ้นเล็กน้อย */
}

/* --- (เพิ่มใหม่) เอฟเฟกต์เมื่อคลิกปุ่ม --- */
.contact-form .submit-btn:active {
    transform: translateY(0) scale(0.98); /* ยุบปุ่มลง */
    box-shadow: 0 2px 5px rgba(0, 51, 102, 0.2);
}

/* --- คอลัมน์ขวา: แผนที่ --- */
.contact-map {
    width: 100%;
    height: 100%;
    min-height: 450px;
    
    /* -- เพิ่ม 3 บรรทัดนี้ -- */
    display: flex;
    justify-content: center; /* จัดกลางแนวนอน */
    align-items: center;     /* จัดกลางแนวตั้ง */
}
.contact-map iframe {
    /* width: 100%; */  /* -- ลบ หรือ คอมเมนต์ บรรทัดนี้ -- */
    /* height: 100%; */ /* -- ลบ หรือ คอมเมนต์ บรรทัดนี้ -- */
    
    /* -- เพิ่ม/แก้ไขเป็น 3 บรรทัดนี้ -- */
    width: 600px;     /* ความกว้างที่ต้องการ (จาก HTML ของคุณ) */
    height: 450px;    /* ความสูงที่ต้องการ (จาก HTML ของคุณ) */
    max-width: 100%;  /* สำคัญ! เพื่อให้ responsive บนมือถือ */
    
    /* (ของเดิมคงไว้) */
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ================================================== */
/* == CSS สำหรับหน้าโครงสร้างการบริหาร (structure.php) == */
/* ================================================== */

/* --- ส่วนแสดงผังรูปภาพ (Org Chart) --- */
.structure-chart-container {
    width: 100%;
    max-width: 1000px; /* กำหนดความกว้างสูงสุดของผัง */
    margin: 1rem auto 3rem auto; /* จัดกึ่งกลาง */
    padding: 1rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.07);
}

.structure-chart-container img {
    width: 100%; /* ทำให้รูปภาพ responsive */
    height: auto;
    display: block;
    border-radius: 8px;
}

/* --- ส่วนแสดงกล่อง 4 ฝ่ายบริหาร --- */
.structure-group-list {
    display: grid;
    /* - จอใหญ่: 4 คอลัมน์ 
      - จอแท็บเล็ต (ต่ำกว่า 992px): 2 คอลัมน์
      - จอมือถือ (ต่ำกว่า 576px): 1 คอลัมน์
    */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .structure-group-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .structure-group-list {
        grid-template-columns: 1fr;
    }
}

/* --- สไตล์ของกล่องแต่ละฝ่าย --- */
.structure-group-item {
    display: block;
    padding: 2rem 1.5rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-decoration: none;
    color: #003366; /* สีหลัก */
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.structure-group-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.1);
    border-color: #003366;
    color: #004a8d;
}
