/* assets/css/main.css */
:root {
    --primary-color: #059669; --primary-dark: #047857; --primary-light: #10b981;
    --secondary-color: #34d399; --accent-color: #065f46; --success-color: #10b981;
    --warning-color: #f59e0b; --danger-color: #ef4444; --dark-color: #1f2937;
    --light-gray: #f9fafb; --border-color: #e5e7eb; --text-dark: #111827;
    --text-light: #6b7280; --white: #ffffff;
    --white: #ffffff;

    /* --- [NEW] เพิ่มตัวแปรสำหรับเงา --- */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
/* === FIX: Code for removing top white space === */
html, body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* --- [NEW] Typography System --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}
h2 {
    font-size: 2.5rem;
}
p {
    line-height: 1.7;
    color: var(--text-light);
}
/* --- Header & Navbar --- */
.top-bar {
    background-color: var(--primary-dark);
    padding: 0.5rem 0;
    font-size: 0.85rem;
}
.top-bar a { color: var(--white); text-decoration: none; opacity: 0.8; transition: opacity 0.3s; }
.top-bar a:hover { opacity: 1; }

.navbar {
    transition: background 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
    padding: 1rem;
}
/* Navbar scrolled effect (ถ้าต้องการใช้) */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
}
.navbar-brand img { height: 50px; transition: height 0.4s ease-in-out; }
.navbar.scrolled .navbar-brand img { height: 45px; }

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s;
}
.navbar-nav .nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%; 
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}
.navbar-nav .nav-link:hover:after,
.navbar-nav .nav-link.active:after {
    width: 60%;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-toggler { border-color: rgba(0,0,0,0.1); }
.navbar-toggler-icon { 
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(5, 150, 105, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Main Content & Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    padding: 4rem 0;
    color: var(--white);
    text-align: center;
}
.bg_content { padding-top: 0px; padding-bottom: 40px; }

/* --- Modern Footer --- */
.footer {
    background: var(--dark-color);
    color: var(--text-light);
    padding: 4rem 0 2rem 0;
    margin-top: 40px;
}
.footer h5 { color: var(--white); font-weight: 600; margin-bottom: 1.5rem; }
.footer p, .footer li { font-size: 0.95rem; }
.footer a { color: var(--text-light); text-decoration: none; transition: color 0.3s, padding-left 0.3s; }
.footer a:hover { color: var(--primary-light); padding-left: 5px; }
.footer .footer-links { list-style: none; padding-left: 0; }
.footer .footer-links li { margin-bottom: 0.8rem; }
.footer .social-icons a {
    color: var(--text-light); font-size: 1.2rem;
    margin-right: 1rem;
    transition: color 0.3s, transform 0.3s;
}
.footer .social-icons a:hover { color: var(--white); transform: translateY(-3px); }
.footer .bottom-bar {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}
/* ========================================================= */
/* === [UPDATED] Hero Section - ปรับปรุงให้สวยงามและพอดี === */
/* ========================================================= */
.hero-section {
    position: relative; /* สำหรับวางองค์ประกอบอื่นทับซ้อนได้ */
    min-height:20vh; /* ลดความสูงลงเล็กน้อย ให้เห็นเนื้อหาถัดไปได้ง่ายขึ้น */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white); /* สีข้อความขาว */
    padding: 3rem 1rem; /* Padding สำหรับหน้าจอเล็ก */
    overflow: hidden; /* ป้องกันเนื้อหาล้นออกนอก */

    /* พื้นหลัง: ใส่รูปภาพและ Gradient ทับ */
     background: 
        linear-gradient(135deg, rgba(4, 120, 87, 0.85) 0%, rgba(5, 150, 105, 0.85) 100%), /* Green gradient overlay */
        url('images/background.jpg') no-repeat center center; /* รูปภาพพื้นหลังที่ยังคงอยู่ */
    background-size: cover;
    background-attachment: fixed; /* Parallax effect */
    background-position: center; /* ให้รูปภาพอยู่กึ่งกลาง */
}

/* เพิ่มองค์ประกอบตกแต่งด้านหลัง (Optional: ลบได้ถ้าไม่ชอบ) */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.05) 0%, transparent 40%),
                radial-gradient(circle at bottom right, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none; /* ทำให้คลิกผ่านได้ */
}

.hero-section .container {
    position: relative;
    z-index: 10; /* ให้เนื้อหาอยู่บน overlay */
    max-width: 900px; /* กำหนดความกว้างสูงสุดของเนื้อหาใน Hero */
}

/* === [FIX] แก้ไขสีตัวอักษรใน Hero Section === */
.hero-section h1 {
    color: var(--white); /* [FIX] กำหนดให้เป็นสีขาวโดยตรง */
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
}

.hero-section p {
    color: rgba(255, 255, 255, 0.95); /* [FIX] กำหนดเป็นสีขาว (โปร่งแสงเล็กน้อย) */
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 1; /* [CHANGED] ปรับ opacity มากำหนดที่สีแทน */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================= */
/* === [UPDATED] Modern Buttons (ปุ่ม) === */
/* ========================================= */
.btn-modern {
    padding: 14px 35px; /* เพิ่มขนาดปุ่ม */
    border-radius: 50px; /* ทรงแคปซูล */
    font-weight: 600;
    font-size: 1.05rem; /* เพิ่มขนาดฟอนต์ในปุ่ม */
    border-width: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animation แบบนุ่มนวล */
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15); /* เงาปุ่ม */
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden; /* สำหรับ effect */
    display: inline-flex; /* ให้ icon และ text อยู่ตรงกลาง */
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md); /* [CHANGED] */
}

.btn-modern i {
    margin-right: 8px; /* ระยะห่างระหว่าง icon กับ text */
    font-size: 1.1rem;
}

/* ปุ่มหลัก - ลงทะเบียนเลย */
.btn-primary-modern {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%); /* ไล่สีปุ่มหลัก */
    border-color: var(--primary-color);
    color: var(--white);
}
.btn-primary-modern:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary-color) 100%); /* เปลี่ยนสีเมื่อ hover */
    border-color: var(--primary-light);
    transform: translateY(-3px); /* ลอยขึ้นเล็กน้อย */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25); /* เงาที่ชัดขึ้น */
}

/* ปุ่มรอง - ดูกำหนดการ */
.btn-outline-light-modern { /* เปลี่ยนชื่อ class เพื่อความชัดเจน */
    background: transparent;
    border-color: rgba(255, 255, 255, 0.7); /* ขอบสีขาวใส */
    color: var(--white);
}
.btn-outline-light-modern:hover {
    background: rgba(255, 255, 255, 0.1); /* พื้นหลังสีขาวใสเมื่อ hover */
    border-color: var(--white);
    color: var(--white); /* รักษาสีตัวอักษร */
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh; /* ลดความสูงบนมือถือ */
        padding: 2rem 1rem;
    }
    .hero-section h1 {
        font-size: 2.2rem; /* ขนาด H1 บนมือถือ */
    }
    .hero-section p {
        font-size: 1rem; /* ขนาด p บนมือถือ */
        margin-bottom: 2rem;
    }
    .btn-modern {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    .btn-modern i {
        font-size: 1rem;
    }
    .d-flex.gap-3.justify-content-center {
        flex-direction: column; /* ให้ปุ่มเรียงกันลงมาบนมือถือ */
        align-items: center;
        gap: 1rem !important; /* เพิ่มระยะห่างระหว่างปุ่ม */
    }
}
/* ================================================= */
/* === [UPDATED] Feature Section - ทำไมต้องอบรมกับเรา? === */
/* ================================================= */

/* ส่วนของหัวข้อหลัก "ทำไมต้องอบรมกับเรา?" */
.section-title {
    margin-bottom: 4rem; /* เพิ่มระยะห่างด้านล่าง */
}
.section-title h2 {
    font-weight: 700;
    font-size: 2.8rem; /* เพิ่มขนาดหัวข้อ */
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 1.5rem; /* ระยะห่างกับ subtitle */
    color: var(--text-dark);
}
/* เส้นใต้หัวข้อ */
.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 80px;
    height: 5px; /* ทำให้เส้นหนาขึ้น */
    background: var(--primary-color); /* ใช้สีเขียวหลัก */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px; /* โค้งมนเล็กน้อย */
}
.section-title p.fs-5 {
    font-size: 1.15rem !important; /* ปรับขนาดข้อความรอง */
    color: var(--text-light);
    max-width: 700px; /* จำกัดความกว้าง */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}


/* แก้ไข .feature-card ให้สั้นลง */
.feature-card {
    padding: 2.5rem 2rem;
    text-align: center;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-shadow: var(--shadow-md); /* [CHANGED] */
}
.feature-card:hover {
    transform: translateY(-12px); /* การ์ดลอยขึ้นเมื่อชี้ */
    box-shadow: var(--shadow-lg); /* [CHANGED] */
}

/* สไตล์ของ Icon */
.feature-icon {
    width: 85px; /* ขนาดของวงกลมไอคอน */
    height: 85px;
    margin: 0 auto 1.8rem; /* ระยะห่างกับหัวข้อ */
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color)); /* ไล่สีพื้นหลังไอคอน */
    color: var(--white);
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px; /* ขนาดของตัวไอคอน */
    box-shadow: 0 10px 20px rgba(5, 150, 105, 0.4); /* เงาไอคอน */
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.08); /* Icon ขยายเล็กน้อยเมื่อการ์ดถูกชี้ */
}

/* สไตล์ของหัวข้อใน Card */
.feature-card h3 {
    font-size: 1.5rem; /* ขนาดหัวข้อ */
    font-weight: 700; /* น้ำหนักฟอนต์หัวข้อ */
    color: var(--text-dark);
    margin-bottom: 0.8rem; /* ระยะห่างกับรายละเอียด */
}

/* สไตล์ของรายละเอียดใน Card */
.feature-card p.text-muted {
    font-size: 1rem; /* ขนาดรายละเอียด */
    color: var(--text-light) !important; /* บังคับใช้สีเทาอ่อน */
    line-height: 1.6;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 992px) {
    .section-title h2 {
        font-size: 2.2rem;
    }
    .feature-card {
        padding: 2rem 1.5rem;
    }
    .feature-icon {
        width: 75px;
        height: 75px;
        font-size: 32px;
        margin-bottom: 1.5rem;
    }
    .feature-card h3 {
        font-size: 1.3rem;
    }
}
@media (max-width: 576px) {
    .section-title h2 {
        font-size: 2rem;
    }
    .feature-card {
        padding: 1.8rem 1rem;
    }
    .feature-icon {
        width: 65px;
        height: 65px;
        font-size: 28px;
        margin-bottom: 1.2rem;
    }
    .feature-card h3 {
        font-size: 1.2rem;
    }
    .feature-card p.text-muted {
        font-size: 0.95rem;
    }
}
/* ======================================= */
/* === Featured Courses on Homepage === */
/* ======================================= */
.course-card {
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md); /* [CHANGED] */
}
.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    box-shadow: var(--shadow-lg); /* [CHANGED] */
}
.course-card-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
}
.course-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}
.course-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* ทำให้ body ขยายเต็มพื้นที่ที่เหลือ */
}
.course-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    flex-grow: 1;
}
.course-card-body ul li {
    margin-bottom: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: flex-start;
}
.course-card-body ul li i {
    color: var(--primary-color);
    margin-right: 10px;
    margin-top: 5px;
}
.course-card .btn-register {
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
    margin-top: auto; /* ดันปุ่มไปอยู่ล่างสุด */
}
.course-card .btn-register:hover {
    background-color: var(--primary-dark);
}
/* สร้างคลาสนี้ขึ้นมาใหม่ */
.base-card {
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    height: 100%;
}
.base-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
}
/* ================================== */
/* === Contact Page Styles        === */
/* ================================== */
.contact-info-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    /* box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); */
    height: 100%;
    box-shadow: var(--shadow-md); /* [CHANGED] */
}

.contact-info-item {
    display: flex; /* สั่งให้ไอคอนและข้อความเรียงกันในแนวนอน */
    align-items: flex-start; /* [FIX] สั่งให้ทั้งสองอย่างชิดขอบบน */
    margin-bottom: 1.5rem;
}

.contact-info-item .icon-bg {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background-color: var(--light-gray);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1.5rem;
}

.contact-info-item strong {
    font-weight: 600;
    color: var(--text-dark);
}

.map-card {
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    min-height: 450px;
}

.map-card iframe {
    width: 100%;
    height: 100%;
    border: none;
}
/* ================================== */
/* === Payment Notice / Invoice   === */
/* ================================== */
.invoice-box {
    max-width: 800px;
    margin: auto;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 0 10px rgba(0, 0, 0, .15);
    font-size: 16px;
    line-height: 24px;
    font-family: 'Kanit', sans-serif;
    color: #555;
    background: white;
}
.payment-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* CSS สำหรับการพิมพ์ */
@media print {
    body, .invoice-box {
        box-shadow: none;
        border: none;
    }
    .no-print, .top-bar, .navbar, .footer {
        display: none !important;
    }
    .invoice-box {
        padding: 0;
    }
}
/* --- [NEW] Section Divider --- */
.section-divider {
    position: relative;
    width: 100%;
    height: 100px; /* ความสูงของเส้นโค้ง */
    overflow: hidden;
}
.section-divider svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.shape-fill {
    fill: var(--light-gray); /* สีพื้นหลังของ Section ถัดไป */
}
/* --- [NEW] Responsive Refinements --- */
@media (max-width: 576px) {
    /* ลดขนาดหัวข้อใหญ่บนมือถือ */
    h2 {
        font-size: 2rem;
    }
    
    /* ลด padding ของ section ต่างๆ บนมือถือเพื่อให้มีพื้นที่มากขึ้น */
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* ซ่อนรูปภาพด้านข้างในหน้าลงทะเบียนบนมือถือ เพื่อให้ผู้ใช้โฟกัสที่ฟอร์ม */
    .registration-container .side-panel {
        display: none;
    }
    
    /* ทำให้ฟอร์มลงทะเบียนใช้พื้นที่เต็มความกว้าง */
    .registration-container .col-lg-8 {
        width: 100%;
    }
}

/* --- [NEW] CSS For Printing Multiple Invoices --- */
@media print {
    .invoice-box {
        page-break-after: always; /* สั่งให้ขึ้นหน้าใหม่หลังจบแต่ละกล่อง */
    }
    .invoice-box:last-child {
        page-break-after: auto; /* ไม่ต้องขึ้นหน้าใหม่สำหรับกล่องสุดท้าย */
    }
}

/* ================================== */
/* === [NEW] Checkout Page Styles === */
/* ================================== */

.checkout-card {
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    height: 100%;
}

.order-summary-title, .payment-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.course-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.course-item .course-name {
    color: var(--text-dark);
    font-weight: 500;
}
.course-item .course-price {
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
    margin-left: 1rem;
}

.summary-total {
    border-top: 2px solid var(--border-color);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.summary-total .total-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}
.summary-total .total-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.registrant-details {
    margin-top: 2rem;
    font-size: 0.95rem;
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
}
.registrant-details p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.payment-card .qr-code-wrapper {
    text-align: center;
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background-color: var(--light-gray);
}
.payment-card .qr-code-wrapper img {
    max-width: 250px;
    width: 100%;
}
.payment-card .payment-amount-display {
    text-align: center;
    margin-bottom: 1.5rem;
}
.payment-card .payment-amount-display .amount-label {
    font-size: 1rem;
    color: var(--text-light);
}
.payment-card .payment-amount-display .amount-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

/* --- [NEW] Status Badge Styles --- */
.badge {
    padding: 0.5em 0.8em;
    font-size: 0.85rem;
    font-weight: 600;
}