/* --- Landing Page CSS Revamped (Black & White Theme) --- */

:root {
    /* 1. เปลี่ยนโทนสีเป็นขาว-ดำ */
    --primary-color: #1f2937;      /* สีเทาเข้มเกือบดำ */
    --background-color: #ffffff;   /* สีขาว */
    --surface-color: #f8fafc;       /* สีเทาอ่อนมากๆ สำหรับพื้นหลัง section */
    --text-primary: #111827;        /* สีตัวอักษรหลัก (ดำ) */
    --text-secondary: #6b7280;     /* สีตัวอักษรรอง (เทา) */
    --radius: 1.0rem;
    --shadow: 0 4px 10px -2px rgb(0 0 0 / 0.05);
}

body {
    font-family: 'Kanit', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 1s ease-in-out; /* เพิ่มอนิเมชันเปิดตัว */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px); /* 2. เพิ่มเอฟเฟกต์กระจกฝ้า */
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 2rem;
    transition: color 0.2s ease;
}
.nav-links a:hover {
    color: var(--text-primary);
}
.nav-button {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
}
.nav-button:hover {
    background-color: #374151;
}

/* Hero Section */
.hero {
    background-color: var(--background-color);
    text-align: center;
    padding: 6rem 0;
}
.hero-content h1 {
    font-size: 3.5rem; /* 3. เพิ่มขนาดฟอนต์หัวข้อหลัก */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    animation: slideUp 0.8s ease-out;
}
.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    animation: slideUp 0.8s ease-out 0.2s backwards;
}
.hero-button {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 9999px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease, background-color 0.2s ease;
    animation: slideUp 0.8s ease-out 0.4s backwards;
}
.hero-button:hover {
    transform: translateY(-3px);
    background-color: #374151;
}
.hero-image {
    max-width: 800px;
    margin-top: 5rem;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    animation: popIn 1s ease-out 0.6s backwards;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Features Section */
.features {
    padding: 6rem 0;
    text-align: center;
}
.features h2 {
    font-size: 2.25rem;
    margin-bottom: 4rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: left;
}
.feature-card {
    background-color: var(--surface-color);
    padding: 2.5rem; /* 4. ปรับ Layout ให้โปร่งขึ้น */
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
}
.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Pricing Section */
.pricing {
    padding: 6rem 0;
    background-color: var(--surface-color);
    text-align: center;
}
.pricing h2 {
    font-size: 2.25rem;
    margin-bottom: 4rem;
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.pricing-card {
    background-color: var(--background-color);
    border: 1px solid #e5e7eb;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* --- เพิ่ม 2 บรรทัดนี้ --- */
    display: flex;
    flex-direction: column;
}
.pricing-card.popular {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    border-color: var(--primary-color);
}
.pricing-card h3 {
    font-size: 1.25rem;
}
.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0;
}
.price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    /* --- เพิ่มบรรทัดนี้ --- */
    flex-grow: 1; /* << คำสั่งวิเศษที่ทำให้ list ยืดตัว ดันปุ่มลงไปข้างล่าง */
}
.pricing-card li {
    padding: 0.75rem 0; /* 5. ปรับ Layout ให้โปร่งขึ้น */
    color: var(--text-secondary);
}
.pricing-button {
    display: block;
    text-align: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    transition: background-color 0.2s, color 0.2s;
}
.pricing-button:hover, .pricing-card.popular .pricing-button {
    background-color: var(--primary-color);
    color: white;
}

/* Footer */
.footer {
    padding: 3rem 0; /* 6. ปรับ Layout ให้โปร่งขึ้น */
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid #e5e7eb;
}
.nav-logo img {
    height: 50px; /* << ปรับความสูงโลโก้ตรงนี้ได้เลย */
    width: auto;
    display: block;
}

/* --- On-Scroll Animations --- */

/* 1. ซ่อนการ์ดไว้ก่อนเป็นค่าเริ่มต้น */
.feature-card, .pricing-card {
    opacity: 0;
    transform: translateY(30px); /* ดันลงไปข้างล่างเล็กน้อย */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 2. ทำให้การ์ดแสดงผลเมื่อมี class 'visible' */
.feature-card.visible, .pricing-card.visible {
    opacity: 1;
    transform: translateY(0); /* เลื่อนกลับมาที่ตำแหน่งเดิม */
}

/* 3. ทำให้การ์ดแต่ละใบแสดงผลไล่เลี่ยกัน (Stagger Effect) */
.feature-card:nth-child(2), .pricing-card:nth-child(2) {
    transition-delay: 0.1s;
}
.feature-card:nth-child(3), .pricing-card:nth-child(3) {
    transition-delay: 0.2s;
}
/* --- Contact Section --- */
.contact {
    padding: 6rem 0;
    text-align: center;
}
.contact h2 {
    font-size: 2.25rem;
    margin-bottom: 3rem;
}
.contact-grid {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.contact-details {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-secondary);
}
.contact-details p {
    margin: 0.5rem 0;
}
.contact-details strong {
    color: var(--text-primary);
}
.social-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-links a {
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
}
.social-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}
/* --- Policy Modal Styles --- */
.policy-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.policy-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    width: 80%;
    max-width: 800px;
    position: relative;
    animation: slideUp 0.4s ease-out;
}

.policy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.policy-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover,
.close-btn:focus {
    color: #333;
}

.policy-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px; /* for scrollbar */
    line-height: 1.7;
}
.policy-modal-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.policy-modal-body ul {
    padding-left: 20px;
}

/* --- Footer Links --- */
.footer-links {
    margin-bottom: 1rem;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: var(--primary-color);
}
.footer-links span {
    color: var(--text-secondary);
}