/* style.css */

/* กำหนดสีหลักของเว็บไซต์ และใช้ CSS Variables เพื่อให้ปรับแก้ได้ง่าย */
:root {
    --primary-color: #5465ff; /* สีน้ำเงินที่สว่างขึ้น */
    --secondary-color: #28a745; /* สีเขียว */
    --bg-color: #f0f4f8; /* สีพื้นหลังที่นุ่มนวล */
    --text-color: #34495e; /* สีข้อความที่เข้มขึ้น */
    --accent-color: #e74c3c; /* สีสำหรับเน้น */
    --link-hover-color: #3498db; /* สีเมื่อนำเมาส์ไปวางบนลิงก์ */
}

/* ตั้งค่าเริ่มต้นสำหรับทุกองค์ประกอบ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* ทำให้การเลื่อนหน้าเป็นไปอย่างราบรื่น */
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar: แถบเมนูนำทาง */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar .logo:hover {
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--link-hover-color);
    transform: translateY(-2px);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hamburger-menu span {
    height: 3px;
    width: 25px;
    background-color: var(--text-color);
    margin-bottom: 4px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Responsive สำหรับ Navbar */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: white;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        text-align: center;
        margin: 0.5rem 0;
    }
    .hamburger-menu {
        display: flex;
    }
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

main {
    padding-top: 80px; /* เพื่อหลีกเลี่ยง Navbar บังเนื้อหา */
    flex-grow: 1; /* ทำให้ main ขยายเต็มพื้นที่ที่เหลือ */
}

/* Footer: ส่วนท้ายของเว็บไซต์ */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: white;
    margin-top: auto;
}

/* Styles เฉพาะสำหรับหน้าแรก */
.hero {
    background-image: url('picture/modernbackground.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px); /* เพิ่มความเบลอเล็กน้อย */
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.cta-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Styles เฉพาะสำหรับหน้าห้องเรียนออนไลน์และบทเรียน */
.page-header {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.page-header p {
    font-size: 1.25rem;
}

.content-container {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
}

.classroom-container {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
}
.classroom-section {
    margin-bottom: 3rem;
}
.classroom-section h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 2rem;
}
.classroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.classroom-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.classroom-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 30px rgba(0,0,0,0.1);
}
.classroom-card h3 {
    color: var(--primary-color);
    margin: 0 0 0.5rem;
}
.classroom-card p {
    margin: 0.5rem 0;
    color: #666;
}
.classroom-links a {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}
.classroom-links a:hover {
    background-color: var(--primary-color);
}

.content-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 3rem;
}
.content-section h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}
.lesson-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-direction: row;
}
.lesson-card:nth-child(even) {
    flex-direction: row-reverse;
}
.lesson-card img {
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.lesson-card-text h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-top: 0;
}
.lesson-card-text p {
    color: #555;
    line-height: 1.8;
}
.button-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}
.button-link:hover {
    background-color: var(--primary-color);
}
@media (max-width: 768px) {
    .lesson-card, .lesson-card:nth-child(even) {
        flex-direction: column;
    }
    .lesson-card img {
        max-width: 100%;
    }
}

/* Tab styles for pa-evaluation.html */
.tab-menu {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: #e9ecef;
    color: #6c757d;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #dee2e6;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
