/* science_center_website/css/style.css */

/* ---------------------------------- */
/* 1. Google Font Import and Variables */
/* ---------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Thasadith:wght@400;700&display=swap');

:root {
    /* ธีมสีหลัก */
    --color-primary: #003366;      /* กรมท่า (สำหรับ Header/Navbar/Footer) */
    --color-secondary: #ff9900;    /* ส้ม (สำหรับเน้น/ปุ่มหลัก) */
    --color-accent: #38761d;       /* เขียวเข้ม (สำหรับลิงก์/ปุ่มรอง) */
    --color-background: #fcf8e3;   /* เหลืองเปลือกไข่ไก่ (Background) */
    --color-text: #333333;
    --color-light: #ffffff;
    --color-border: #e0e0e0;
    
    /* Font */
    --font-main: 'Thasadith', sans-serif;
}

/* ---------------------------------- */
/* 2. Base Styling & Layout */
/* ---------------------------------- */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

h2 {
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 25px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-secondary);
}

.text-right {
    text-align: right;
}

/* ---------------------------------- */
/* 3. Header & Navigation (Navbar) */
/* ---------------------------------- */

header {
    background-color: var(--color-primary);
    color: var(--color-light);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

header h1 {
    color: var(--color-light);
    font-size: 1.8em;
    margin: 0;
    padding: 5px 0;
}

/* Navbar */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav li {
    margin-left: 15px;
}

.main-nav a {
    display: block;
    padding: 10px 15px;
    color: var(--color-light);
    font-weight: 700;
    transition: background-color 0.3s, color 0.3s;
    border-bottom: 3px solid transparent; /* สำหรับ active link */
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-light);
    border-bottom: 3px solid var(--color-secondary);
}

/* Active Link Style */
.main-nav a.active {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-light);
}

/* Highlight Button in Navbar (สำหรับลงทะเบียน/ยื่นคำขอ) */
.main-nav li.btn-highlight a {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    border-radius: 4px;
    padding: 8px 15px;
}

.main-nav li.btn-highlight a:hover {
    background-color: #ffb74d; /* ส้มอ่อนลง */
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-light);
}

/* ---------------------------------- */
/* 4. Content Area (Home Page Specific) */
/* ---------------------------------- */

.intro-text {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 20px auto 40px auto;
    padding: 15px;
    border: 1px dashed var(--color-primary);
    background-color: #ffffff;
    border-radius: 5px;
}

section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--color-light);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* News Grid */
.news-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.news-card {
    flex: 1 1 calc(33.333% - 20px); /* 3 items per row */
    min-width: 280px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background-color: #f7f7f7;
    transition: transform 0.3s;
}

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

.news-card h4 a {
    color: var(--color-primary);
    font-size: 1.2em;
    display: block;
    margin-bottom: 5px;
}

.news-card small {
    display: block;
    color: #777;
    margin-bottom: 10px;
}

.news-category-tag {
    font-size: 0.8em;
    color: var(--color-accent);
    font-weight: 700;
}

/* Services Grid */
.services-grid {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap; 
}

.service-item {
    padding: 25px;
    width: 32%; /* 3 items per row */
    min-width: 250px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: #fcfcfc;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.service-item h4 {
    color: var(--color-secondary);
    margin-top: 0;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #fffaf0;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
    margin-top: 10px;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    border: 1px solid var(--color-secondary);
}

.btn-primary:hover {
    background-color: #ffb74d;
    color: var(--color-primary);
}

.btn-secondary {
    background-color: var(--color-accent);
    color: var(--color-light);
    border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
    background-color: #559933;
    color: var(--color-light);
}


/* ---------------------------------- */
/* 5. Footer */
/* ---------------------------------- */

footer {
    background-color: var(--color-primary);
    color: #f0f0f0;
    padding: 30px 0 10px 0;
    margin-top: 30px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.footer-col-sub {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-col-sub h4 {
    color: var(--color-secondary);
    margin-top: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.footer-col-sub p {
    font-size: 0.9em;
}

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

.footer-col-sub a {
    color: #ccc;
}

.footer-col-sub a:hover {
    color: var(--color-secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding-top: 10px;
    font-size: 0.8em;
}

/* science_center_website/css/style.css (ส่วนเพิ่มเติม) */

/* ---------------------------------- */
/* ANALYSIS/SERVICE PAGE STYLING */
/* ---------------------------------- */

.page-header {
    font-size: 2.2em;
    color: var(--color-primary);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 5px;
}

/* ตาราง */
.service-table-wrapper {
    overflow-x: auto; /* เพื่อให้ตารางเลื่อนได้เมื่ออยู่บนมือถือ */
    margin-top: 20px;
}

.analysis-list-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.analysis-list-container th, 
.analysis-list-container td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.analysis-list-container th {
    background-color: var(--color-primary);
    color: var(--color-light);
    font-weight: bold;
    text-transform: uppercase;
}

.analysis-list-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

.analysis-list-container tr:hover {
    background-color: #f1f1f1;
}

.service-description-mini {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* ---------------------------------- */
/* 6. Responsive Design (ปรับให้รองรับมือถือ) */
/* ---------------------------------- */

@media (max-width: 900px) {
    .news-card {
        flex: 1 1 calc(50% - 20px); /* 2 items per row */
    }
    .service-item {
        width: 48%; /* 2 items per row */
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    header h1 {
        margin-bottom: 10px;
    }
    .main-nav ul {
        flex-direction: column;
    }
    .main-nav li {
        margin: 5px 0;
    }
    .main-nav li.btn-highlight a {
        border-radius: 0;
    }
    .main-nav a.active {
        border-bottom: none;
        border-left: 5px solid var(--color-light);
    }
    .news-card, .service-item {
        flex: 1 1 100%; /* 1 item per row */
        width: 100%;
    }
    .footer-grid {
        flex-direction: column;
    }

.icon-instrument::before { content: "🔬"; } /* หรือใช้ Font Awesome */
.icon-analysis::before { content: "🧪"; }
.icon-camp::before { content: "🏕️"; }
.icon-download::before { content: "⬇️"; }





}