/* Custom styles */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0664a3;
    --secondary-color: #d8e1e4;
    --text-color: #333;
    --border-radius: 8px;
    --nav-height: 70px;
    --nav-bg: #fff;
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --container-width: 1400px;
    --container-padding: 2rem;
    --grid-gap: 2rem;
    --sidebar-width: 360px;
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    line-height: 1.6;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
    box-sizing: border-box;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=1600&h=600&fit=crop') center/cover;
    height: 400px;
    border-radius: var(--border-radius);
    margin: var(--grid-gap) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--grid-gap);
    margin: var(--grid-gap) 0;
}

/* Article Cards */
.article-grid {
    display: grid;
    gap: var(--grid-gap);
}

.article-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card.featured {
    grid-column: 1 / -1;
}

.article-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.article-card.featured .article-image {
    height: 400px;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 1.5rem;
}

.article-content h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin: 1rem 0;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--nav-height) + var(--grid-gap));
    height: fit-content;
}

.sidebar-section {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: var(--grid-gap);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.popular-post:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.popular-post .article-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.popular-post .article-link:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.popular-post img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
}

.popular-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.popular-post-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #2c3e50;
}

.popular-post-content .views {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.popular-post-content .read-more {
    display: inline-block;
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: auto;
}

.popular-post .article-link:hover .read-more {
    color: #2980b9;
}

/* Categories */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    border-bottom: 1px solid #eee;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.category-list a:hover {
    color: var(--primary-color);
}

/* Newsletter Form */
.newsletter-form {
    text-align: center;
}

.newsletter-form p {
    margin-bottom: 1rem;
}

.newsletter-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.btn-signup {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-signup:hover {
    background-color: #234445;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--nav-bg);
    box-shadow: var(--nav-shadow);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand i {
    font-size: 1.2em;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav-toggle-active .hamburger {
    background: transparent;
}

.nav-toggle-active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle-active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

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

/* Main Content */
main {
    margin-top: var(--nav-height);
    padding: var(--container-padding) 0;
}

/* Slider Section */
.slider-container {
    background-color: #DFE8E9;
    padding: 3rem 2rem;
    margin: 2rem 0;
    border-radius: 20px;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.slider-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.5),
            transparent);
}

.slider-row {
    display: flex;
    gap: 25px;
    margin: 0 -10px;
    padding: 0 10px;
    transition: transform 0.5s ease;
}

.slider-card {
    flex: 0 0 calc(50% - 12.5px);
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.slider-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
    .slider-card {
        flex: 0 0 calc(33.333% - 17px);
    }
}

.slider-card-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.slider-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-card-content {
    padding: 20px;
    text-align: center;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.95),
            white);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slider-card-content h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.slider-controls {
    position: relative;
    margin-top: 30px;
    text-align: center;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot:hover {
    background: rgba(0, 0, 0, 0.4);
}

.slider-dot.active {
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .slider-container {
        height: auto;
        padding: 2.5rem 1.5rem;
    }

    .slider-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .slider-container {
        padding: 2rem 1rem;
        margin: 1.5rem 0;
    }

    .slider-row {
        gap: 15px;
    }

    .slider-card {
        flex: 0 0 calc(50% - 7.5px);
    }

    .slider-card-content {
        padding: 15px;
    }

    .slider-card-content h3 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .slider-container {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
    }

    .slider-row {
        gap: 12px;
    }

    .slider-card {
        flex: 0 0 calc(50% - 6px);
    }

    .slider-card-content {
        padding: 12px;
    }

    .slider-card-content h3 {
        font-size: 0.9rem;
    }

    .slider-dots {
        gap: 8px;
    }

    .slider-dot {
        width: 6px;
        height: 6px;
    }

    .slider-dot.active {
        width: 8px;
        height: 8px;
    }
}

/* Features Section */
.features-section {
    margin-bottom: var(--grid-gap);
}

.section-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
    margin-bottom: var(--grid-gap);
}

.feature-item {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.feature-item:hover .feature-image img {
    transform: scale(1.1);
}

.feature-content {
    padding: 1.5rem;
}

.feature-content h3 {
    color: var(--primary-color);
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.feature-content p {
    margin: 0 0 1rem;
    line-height: 1.6;
}

.feature-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Newsletter Section */
.newsletter-section {
    background-color: var(--secondary-color);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: var(--grid-gap);
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem auto 0;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    min-width: 0;
}

.btn-signup {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-signup:hover {
    background-color: #234445;
}

/* Footer */
footer {
    background-color: var(--nav-bg);
    padding: 2rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    text-align: center;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Responsive Design */
@media (max-width: 1200px) {
    :root {
        --container-padding: 1.5rem;
        --grid-gap: 1.5rem;
        --sidebar-width: 300px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .slider-card img {
        width: 100%;
        height: 260px;
    }

    .slider-container {
        height: 450px;
    }
}

@media (max-width: 992px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--nav-bg);
        padding: 1rem;
        box-shadow: var(--nav-shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-menu-visible {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .article-card.featured .article-image {
        height: 300px;
    }

    .slider-card img {
        width: 100%;
        height: 220px;
    }

    .slider-container {
        height: 400px;
    }

    .slider-card-content h3 {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
        --grid-gap: 1rem;
    }

    .hero-section {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .article-image {
        height: 200px;
    }

    .article-card.featured .article-image {
        height: 250px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .btn-signup {
        width: 100%;
    }

    .slider-container {
        height: 350px;
        padding: 1.5rem 0;
    }

    .slider-card img {
        width: 100%;
        height: 180px;
    }

    .slider-card-content h3 {
        font-size: 0.9rem;
    }

    .slider-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        height: 250px;
    }

    .article-content {
        padding: 1rem;
    }

    .sidebar-section {
        padding: 1rem;
    }

    .slider-container {
        height: 200px;
        padding: 1rem 0;
    }

    .slider-card img {
        width: 100%;
        height: 160px;
    }

    .slider-card-content h3 {
        font-size: 0.8rem;
    }

    .slider-nav {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .newsletter-section {
        padding: 2rem 1rem;
    }
}

.navbar-logo {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    object-fit: contain;
}

/* Auth Pages */
.auth-wrapper {
    min-height: calc(100vh - var(--nav-height) - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.auth-form .input-group-text {
    background-color: var(--secondary-color);
    border-color: #ddd;
    color: var(--primary-color);
}

.auth-form .form-control {
    border-color: #ddd;
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(47, 90, 92, 0.25);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.auth-footer p {
    margin-bottom: 0.5rem;
}

.forgot-password {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password:hover {
    color: var(--primary-color);
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
}

.dropdown-item:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #eee;
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }
}

/* Password Requirements */
.password-requirements {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.password-requirements li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.25rem;
    color: #666;
}

.password-requirements li::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .input-group-text {
    min-width: 40px;
    justify-content: center;
}

.auth-form .form-control.is-invalid {
    border-color: #dc3545;
}

.auth-form .form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.auth-form .form-control.is-invalid+.input-group-text {
    border-color: #dc3545;
    color: #dc3545;
}

@media (max-width: 576px) {
    .password-requirements {
        font-size: 0.8rem;
    }

    .password-requirements li {
        margin-bottom: 0.2rem;
    }
}

.slider-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.slider-link:hover .slider-card-content h3 {
    color: #3498db;
}

/* Latest News in Sidebar */
.latest-news {
    display: grid;
    gap: 1rem;
}

.news-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.news-content h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--primary-color);
}

.news-content p {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
    color: #666;
}

.news-date {
    font-size: 0.8rem;
    color: #999;
}

/* News Grid Page */
.news-grid {
    display: grid;
    gap: var(--grid-gap);
    margin: var(--grid-gap) 0;
}

.news-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-card .news-content {
    padding: 1.5rem;
}

.news-card h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin: 1rem 0;
}

/* News Detail Page */
.news-detail {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: var(--grid-gap) 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.news-header {
    margin-bottom: 2rem;
    text-align: center;
}

.news-header h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.news-featured-image {
    margin: 2rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.news-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.back-to-news {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.back-to-news:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .news-item {
        grid-template-columns: 60px 1fr;
    }

    .news-item img {
        width: 60px;
        height: 60px;
    }

    .news-image {
        height: 200px;
    }
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-link:hover {
    text-decoration: none;
    color: inherit;
}

.article-link:hover .read-more {
    color: #234445;
}