:root {
    --primary-color: #4a6741;
    --secondary-color: #8da242;
    --accent-color: #ffd700;
    --text-color: #333;
    --bg-color: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Sarabun', sans-serif;
}

header {
    background-image: url("./images/ddr-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
}

/* เพิ่ม overlay สีเขียวโปร่งแสงเพื่อให้ข้อความอ่านง่าย */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(74, 103, 65, 0),
            /* --primary-color with opacity */
            rgba(141, 162, 66, 0)
            /* --secondary-color with opacity */
        );
    z-index: 1;
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
    /* ให้เนื้อหาอยู่ด้านบน overlay */
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    /* เพิ่มเงาให้ตัวอักษร */
}

.hero p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    /* เพิ่มเงาให้ตัวอักษร */
}

.hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-nav {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.hide-scrollbar::-webkit-scrollbar {
    height: 6px;
}

.hide-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.hide-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.hide-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #666;
}


@media (max-width: 768px) {
    header {
        padding: 2rem 0;
    }

    .hero {
        padding: 1rem;
    }

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

    .hero p {
        font-size: 0.9rem;
    }

    .nav-container {
        gap: 0.5rem;
        padding: 0 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .nav-item i {
        font-size: 1rem;
    }

    .nav-item span {
        font-size: 0.75rem;
    }

    /* ปรับ scrollbar สำหรับมือถือ */
    .hide-scrollbar::-webkit-scrollbar {
        height: 4px;
    }

    /* ปรับ table overflow */
    table {
        font-size: 0.85rem;
    }

    /* ปรับ card spacing */
    .disease-card {
        margin: 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 0;
    }

    .hero {
        padding: 0.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .nav-container {
        gap: 0.25rem;
        padding: 0 0.25rem;
    }

    .nav-item {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .nav-item i {
        font-size: 0.9rem;
    }

    .nav-item span {
        font-size: 0.7rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-item {
        min-height: 44px; /* iOS recommended touch target size */
        min-width: 44px;
    }

    button {
        min-height: 44px;
    }

    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
/*