/* ===================================================
   IMPORT FONTS: IBM PLEX SANS THAI
=================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* ---------- 1. GLOBAL & BASE STYLES ---------- */
* {
    box-sizing: border-box;
}

html, body, body.site {
    background-color: #f9f7fe !important;
    color: #433560 !important;
    font-family: 'IBM Plex Sans Thai', "Segoe UI", sans-serif !important;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .site-title {
    font-family: 'IBM Plex Sans Thai', "Segoe UI", sans-serif !important;
    color: #513e77 !important;
    font-weight: 700;
}

/* ---------- 2. RESPONSIVE BANNER (NO OVERLAP) ---------- */
header.header, .container-header {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%) !important;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15) !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
}

.container-header .site-grid,
.container-header .grid-child {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.navbar-brand {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-brand img,
.container-header img,
.brand-logo img,
header.header img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important; 
    max-height: none !important;
    min-height: none !important;
    aspect-ratio: 2400 / 400 !important;
    object-fit: fill !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
}

.site-title-container, .site-title, .site-description {
    display: none !important; 
}

/* ---------- 3. DESKTOP MENU (>= 1200px) ---------- */
@media (min-width: 1200px) {
    .container-nav {
        display: block !important;
        width: 100% !important;
        padding: 12px 15px 18px 15px !important;
        background: transparent !important;
    }

    .mod-menu, .metismenu.mod-menu {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .mod-menu > li > a, 
    .metismenu.mod-menu > li > a {
        display: inline-flex !important;
        align-items: center;
        padding: 10px 22px !important;
        background: rgba(255, 255, 255, 0.25) !important;
        border: 1px solid rgba(255, 255, 255, 0.45) !important;
        border-radius: 30px !important;
        color: #ffffff !important;
        font-size: 14.5px !important;
        font-weight: 500;
        text-decoration: none !important;
        white-space: nowrap !important;
        backdrop-filter: blur(8px);
        transition: all 0.25s ease;
    }

    .mod-menu > li > a:hover {
        background: #ffffff !important;
        color: #7c3aed !important;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .mod-menu .current > a, 
    .metismenu.mod-menu .active > a {
        background: #ffffff !important;
        color: #7c3aed !important;
        font-weight: 600 !important;
    }

    .navbar-toggler {
        display: none !important;
    }
}

/* ---------- 4. RESPONSIVE SIDEBAR SYSTEM (< 1200px) ---------- */
@media (max-width: 1199.98px) {
    .container-nav {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: flex-end !important;
        padding: 10px 15px !important;
        background: rgba(139, 92, 246, 0.1) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .navbar-toggler, 
    button[data-bs-toggle="collapse"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #ffffff !important;
        border: 1px solid #ddd3f9 !important;
        border-radius: 10px !important;
        width: 110px !important;
        height: 40px !important;
        color: #7c3aed !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1) !important;
    }
    
    .navbar-toggler::after {
        content: " เมนู";
    }

    .navbar-collapse,
    #navbar-main {
        position: fixed !important;
        top: 0 !important;
        right: -320px; 
        left: auto !important;
        width: 300px !important;
        height: 100vh !important;
        background: #ffffff !important; 
        padding: 40px 24px !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12) !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        display: block !important;
        visibility: visible !important;
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .navbar-collapse.show,
    #navbar-main.show {
        transform: translateX(-320px); 
    }

    .mod-menu, .metismenu.mod-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 0 !important;
        margin-top: 30px !important;
        list-style: none !important;
        width: 100% !important;
    }

    .mod-menu > li > a, .metismenu.mod-menu > li > a {
        display: flex !important;
        align-items: center;
        justify-content: flex-start !important;
        background: #f7f5ff !important;
        color: #513e77 !important;
        padding: 14px 20px !important;
        border-radius: 14px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        border: 1px solid #ede8fc !important;
        text-decoration: none !important;
        width: 100% !important;
    }

    .mod-menu .current > a, 
    .metismenu.mod-menu .active > a {
        background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
        color: #ffffff !important;
        border: none !important;
        box-shadow: 0 6px 15px rgba(139, 92, 246, 0.2) !important;
    }

    .metismenu.mod-menu ul {
        position: static !important;
        background: #fbfbfe !important;
        margin: 5px 0 5px 12px !important;
        padding: 6px !important;
        box-shadow: none !important;
        border-radius: 12px !important;
        border: 1px dashed #dcd3f5 !important;
        list-style: none !important;
    }

    body:has(.navbar-collapse.show)::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(43, 31, 68, 0.35);
        backdrop-filter: blur(4px);
        z-index: 99990;
    }
}

/* ---------- 5. CONTENT AREA STYLING ---------- */
main, .component {
    background: #ffffff !important;
    border-radius: 26px !important;
    padding: clamp(20px, 4vw, 40px) !important;
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.05) !important;
    margin-top: 25px;
    border: 1px solid #f1ecfe;
}

.mod-breadcrumbs {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 14px 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    color: #8b5cf6 !important;
    border: 1px solid #f3efff;
}

/* ---------- 6. MODERN PREMIUM FOOTER STYLING (เปลี่ยนจุดไฮไลต์เป็นสีม่วง) ---------- */
.site-footer {
    background-color: #222222 !important;
    color: #e0e0e0 !important;
    padding: 60px 0 0 0 !important;
    margin-top: 50px;
    font-size: 14.5px;
    line-height: 1.6;
    border-top: 4px solid #a78bfa;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr 1fr;
    gap: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-title {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 20px !important;
    position: relative;
    padding-bottom: 10px;
}

/* 🛠️ เปลี่ยนสีเส้นขีดใต้หัวข้อจาก "สีฟ้า" เป็น "สีม่วงพาสเทลสว่าง" */
.footer-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 45px;
    height: 3px;
    background-color: #c4b5fd !important;
    border-radius: 2px;
}

/* 🛠️ เปลี่ยนสีชื่อย่อมหาวิทยาลัยจาก "สีฟ้า" เป็น "สีม่วงพาสเทลสว่าง" */
.university-name {
    color: #c4b5fd !important;
    font-weight: 500;
    margin-top: -12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.info-item p {
    margin: 0;
    color: #cccccc;
}

.info-item strong {
    color: #ffffff;
}

.info-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* กล่องแผนที่ Google Maps */
.footer-map {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid #3d3d3d;
}

.footer-map iframe {
    display: block;
    width: 100% !important;
    height: 160px !important;
    transition: all 0.3s ease;
}

/* 🛠️ เปลี่ยนสีเอฟเฟกต์เรืองแสงรอบแผนที่เมื่อชี้ จาก "สีฟ้า" เป็น "สีม่วง" */
.footer-map:hover {
    box-shadow: 0 6px 20px rgba(196, 181, 253, 0.25) !important;
    border-color: #c4b5fd !important;
}

.footer-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-links li {
    margin-bottom: 12px;
    padding-left: 15px;
    position: relative;
}

/* 🛠️ เปลี่ยนสีตัวลูกศรนำทาง "›" จาก "สีฟ้า" เป็น "สีม่วงพาสเทลสว่าง" */
.footer-links li::before {
    content: "›";
    position: absolute;
    left: 0;
    top: -2px;
    color: #c4b5fd !important;
    font-size: 18px;
    font-weight: bold;
}

.footer-links li a {
    color: #cccccc !important;
    text-decoration: none !important;
    transition: color 0.2s ease, padding 0.2s ease;
}

.footer-links li a:hover {
    color: #ffffff !important;
    padding-left: 4px;
}

/* 🛠️ เปลี่ยนสีลิงก์เบอร์โทรและอีเมลติดต่อลัด จาก "สีฟ้า" เป็น "สีม่วงพาสเทลสว่าง" */
.contacts a {
    color: #c4b5fd !important;
    text-decoration: none !important;
    font-weight: 500;
}
.contacts a:hover {
    color: #ffffff !important;
}

.footer-socials {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.social-btn.fb { background-color: #1877f2; }
.social-btn.web { background-color: #8b5cf6; }

.social-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* แถบเครดิตล่างสุด */
.footer-bottom {
    background-color: #181818 !important;
    padding: 20px 0 !important;
    margin-top: 50px;
    border-top: 1px solid #2d2d2d;
    font-size: 13px;
    color: #aaaaaa;
}

.footer-bottom-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom-container p {
    margin: 0;
}

.bottom-policies a {
    color: #aaaaaa !important;
    text-decoration: none !important;
}

.bottom-policies a:hover {
    color: #ffffff !important;
}

.bottom-policies .divider {
    margin: 0 8px;
    color: #444444;
}

/* ---------- 📱 RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }
}

@media (max-width: 767px) {
    .site-footer {
        padding: 40px 0 0 0 !important;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .footer-bottom-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-map iframe {
        height: 180px !important;
    }
}