/* --- Google Font --- */
@import url('/npm/@fontsource/prompt/index.css');

/* --- CSS Variables (ตัวแปรสี) --- */
:root {
    --primary-color: #41826e; /* สีเขียวตุ่นๆ */
    --white-color: #ffffff;
    --dark-grey-color: #333333; /* สีตัวอักษรหลัก */
    --light-grey-color: #f4f7f6; /* สีพื้นหลังสลับ */
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* กันเมนูบังหัวข้อตอนกดลิงก์ */
}

body {
    font-family: 'Prompt', sans-serif;
    line-height: 1.7;
    color: var(--dark-grey-color);
    background-color: var(--white-color);
}

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

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--primary-color); margin-bottom: 1rem; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; }
.section-bg { background-color: var(--light-grey-color); }
section { padding: 80px 0; }
a { text-decoration: none; }

/* --- Header & Navbar --- */
.header {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo img { height: 50px; }
.nav-menu { display: flex; list-style: none; gap: 30px; }
.nav-link { text-decoration: none; color: var(--dark-grey-color); font-weight: 400; transition: color 0.3s ease; }
.nav-link:hover { color: var(--primary-color); }
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--dark-grey-color); transition: all 0.3s ease-in-out; }

/* --- Hero Section --- */
.hero {
    height: 100vh;
    position: relative; /* สำคัญมาก สำหรับการวาง element ซ้อนกัน */
    overflow: hidden; /* ซ่อนสไลด์ที่อยู่นอกจอ */
    color: var(--white-color);
    display: flex; /* จัดให้ content อยู่กลางจอ */
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 500%; /* 100% ต่อ 1 รูป มี 5 รูป = 500% */
    height: 100%;
    display: flex;
    transition: transform 0.8s ease-in-out; /* เอฟเฟกต์ตอนเลื่อน */
    z-index: 1; /* ให้อยู่หลังสุด */
}

.slide {
    width: 20%; /* 100% / 5 รูป = 20% */
    height: 100vh;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปเต็มพื้นที่โดยไม่เสียสัดส่วน */
}

/* เพิ่ม overlay สีเข้มๆ ให้ข้อความอ่านง่ายขึ้น */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-content {
    position: relative; /* ทำให้มาอยู่บน overlay */
    z-index: 3;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--white-color);
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #356a5a;
}

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

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

.dot.active {
    background-color: var(--white-color);
}

/* --- Services Section --- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.service-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.service-item { background: var(--white-color); padding: 2rem; border-radius: 10px; box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; }
.service-item:hover { transform: translateY(-10px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.service-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }

/* --- NEW: Accordion Styles --- */
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid var(--border-color); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.2rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    color: var(--dark-grey-color);
    text-align: left;
}
.accordion-header .icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 0.5rem;
}
.accordion-content p { margin-bottom: 1rem; color: #555; }
.accordion-item.active .accordion-header .icon { transform: rotate(45deg); }
.accordion-item.active .accordion-content {
    max-height: 200px; /* ตั้งค่าให้สูงพอที่จะแสดงเนื้อหา */
    padding-bottom: 1.5rem;
}
.read-more { color: var(--primary-color); font-weight: 600; }

/* --- Footer Section --- */
.footer { background-color: var(--primary-color); color: var(--white-color); padding: 50px 0 0; }
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding-bottom: 40px; }
.footer h4 { margin-bottom: 1rem; color: var(--white-color); font-size: 1.2rem; }
.footer p, .footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; display: block; margin-bottom: 0.5rem; transition: color 0.3s ease; }
.footer a:hover { color: var(--white-color); }
.footer ul { list-style: none; }
.footer-bottom { text-align: center; padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.2); }

/* --- Fade-in Animation on Scroll --- */
.section-fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.section-fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- Responsive (for Mobile) --- */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .nav-menu { position: fixed; left: -100%; top: 80px; flex-direction: column; background-color: var(--white-color); width: 100%; text-align: center; transition: 0.3s; box-shadow: var(--shadow); }
    .nav-menu.active { left: 0; }
    .nav-menu li { padding: 1rem 0; }
    .hero-title { font-size: 2.5rem; }
    .services-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 2rem; }
}

/* --- Styles for Committee Search Page --- */
#uni-board-page {
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: calc(100vh - 275px);
}

.section-subtitle {
    text-align: center;
    margin-top: -2.5rem;
    margin-bottom: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.search-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--light-grey-color);
    border-radius: 10px;
    margin-bottom: 3rem;
    flex-wrap: wrap; /* ให้ขึ้นบรรทัดใหม่ได้ในจอมือถือ */
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--primary-color);
}

.custom-select {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: 'Prompt', sans-serif;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--white-color);
    color: var(--dark-grey-color);
    min-width: 250px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 130, 110, 0.2);
}

.custom-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

.meeting-report-display {
    margin-top: 2rem;
    min-height: 250px; /* ทำให้มีพื้นที่ว่างตอนแรก */
    display: flex;
    justify-content: center;
    align-items: center;
}

.meeting-report-display .initial-prompt {
    text-align: center;
    color: #aaa;
}

.meeting-report-display .initial-prompt svg {
    stroke: #ccc;
    margin-bottom: 1rem;
}

.report-card {
    background-color: var(--white-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.report-card h3 {
    font-size: 1.8rem;
    margin-top: 0;
}

.report-card .report-date {
    color: #666;
    margin-bottom: 2rem;
}

.btn.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

