/* ======== Global Styles & Variables (คงเดิม) ======== */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #333333;
    --light-text-color: #666666;
    --border-color: #dee2e6;
    --gold-color: #FFD700;
    --font-family: 'Poppins', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

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

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

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

img {
    max-width: 100%;
    display: block;
}

/* ======== Buttons (คงเดิม) ======== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-login {
    background-color: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    margin-left: 15px;
}

.btn-login:hover {
    background-color: #f1f1f1;
}

/* ======== Header & Navbar (คงเดิม) ======== */
.header {
    background-color: var(--surface-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.nav-logo .logo-highlight {
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--light-text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-points {
    background-color: #fffbeb;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    color: #b45309;
}

.user-points i {
    color: var(--gold-color);
    margin-right: 5px;
}


/* ======== NEW: Slider Section ======== */
.slider-container {
    width: 100%;
    height: 60vh;
    /* ความสูงของสไลด์, ปรับได้ตามต้องการ */
    min-height: 400px;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.slide-content {
    background-color: rgba(0, 0, 0, 0.5);
    /* พื้นหลังโปร่งแสงเพื่อให้ข้อความอ่านง่าย */
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 80%;
}

.slide-content h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.slide-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

/* Customizing Swiper Navigation/Pagination Colors */
:root {
    --swiper-navigation-color: #ffffff;
    --swiper-pagination-color: var(--primary-color);
}


/* ======== NEW: Article Section ======== */
.article-section {
    padding: 60px 0;
}

.article-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

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

.article-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.article-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 15px;
    align-self: flex-start;
}

.article-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.article-excerpt {
    color: var(--light-text-color);
    flex-grow: 1;
    margin-bottom: 20px;
}

.read-more-link {
    font-weight: 600;
    color: var(--primary-color);
    transition: letter-spacing 0.3s ease;
}

.read-more-link:hover {
    letter-spacing: 0.5px;
}

/* ======== Footer (คงเดิม) ======== */
.footer {
    background-color: #343a40;
    color: white;
    padding: 30px 0;
    text-align: center;
}

/* ======== Responsive Design (ปรับเล็กน้อย) ======== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .user-info {
        flex-grow: 1;
        justify-content: flex-end;
    }

    .slide-content h1 {
        font-size: 32px;
    }

    .slide-content p {
        font-size: 16px;
    }
}