/*
    คุณสามารถใช้โค้ด CSS ที่คุณให้มาได้ทั้งหมดเลยครับ
    แต่เพื่อความสมบูรณ์ ผมได้รวมและปรับปรุงบางส่วนให้ดูดีขึ้น
    และเพิ่มส่วนของ Layout สำหรับ Hero, About, Programs, News และ Footer เข้าไป
*/

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=K2D:wght@400;500;600;700&display=swap');

/*
 web font 
 
*/

/* @font-face {
    font-family: 'chulacharasnewbold';
    src: url('../fonts/chulacharasnewbold-webfont.woff') format('woff2'),
        url('../fonts/chulacharasnewbold-webfont.woff') format('woff');
    font-weight: 600;
    font-style: normal;

}

@font-face {
    font-family: 'chulacharasnewbold_italic';
    src: url('../fonts/chulacharasnewboldita-webfont.woff2') format('woff2'),
        url('../fonts/chulacharasnewboldita-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

} 

@font-face {
    font-family: 'chulacharasnewitalic';
    src: url('../fonts/chulacharasnewita-webfont.woff2') format('woff2'),
        url('../fonts/chulacharasnewita-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}
@font-face {
    font-family: 'chulacharasnewregular';
    src: url('../fonts/chulacharasnewreg-webfont.woff2') format('woff2'),
        url('../fonts/chulacharasnewreg-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

} */

@font-face {
    font-family: 'chulalongkornbold';
    src: url('../fonts/chulalongkornbold.woff') format('woff');

    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'chulalongkornregular';
    src:  url('../fonts/chulalongkornreg.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

/* --- Root Variables --- */
:root {
    --ubru-pink: #ff6fb4;
    --ubru-pink-light: #ffb8d9;
    --ubru-pink-lighter: #e9e4e6;
    /* fff0f5 d8d6d7 */
    --text-color: #333;
    --hover-color: #ff6fb4;
    --background-light: #f8f8f8;
    --background-gray: #7d7c7cf7;
    --border-color: #eee;
    --primary-font: 'chulalongkornregular', sans-serif;
    --secondary-font: 'chulalongkornbold', sans-serif;
}

.title_pink_eng {
    color: #ff6fb4;
    padding-left: 5px;
}

.title_pink_thai {
    color: #ff6fb4;
}

/* --- Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--primary-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--hover-color);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--ubru-pink);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--ubru-pink);
}

.cta-button {
    display: inline-block;
    background-color: var(--ubru-pink);
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #e55c9d;
}

.secondary-button {
    display: inline-block;
    color: var(--ubru-pink);
    padding: 10px 20px;
    border: 2px solid var(--ubru-pink);
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background-color: var(--ubru-pink);
    color: #fff;
}

/* Logo ubru thai and eng */
/* สำหรับชื่อมหาวิทยาลัยใน navbar */
.navbar-brand {
    display: flex;
    /* ใช้ Flexbox เพื่อจัดเรียงโลโก้และข้อความให้อยู่ในบรรทัดเดียวกัน */
    align-items: center;
    /* จัดให้เนื้อหาอยู่กึ่งกลางในแนวตั้ง */
}

.brand-name-container {
    display: flex;
    /* ใช้ Flexbox สำหรับชื่อมหาวิทยาลัยทั้งสองบรรทัด */
    flex-direction: column;
    /* จัดให้ข้อความแสดงในแนวตั้ง */
    line-height: 1.5;
    /* ปรับระยะห่างระหว่างบรรทัด */
}

.brand-name-th {
    font-size: 20px;
    /* ปรับขนาดฟอนต์ของชื่อภาษาไทย */
    font-weight: 800;
}

.brand-name-en {
    font-size: 16px;
    /* ปรับขนาดฟอนต์ของชื่อภาษาอังกฤษให้เล็กลง */
    opacity: 0.8;
    font-weight: 400;
}

/*... ส่วน CSS อื่นๆ ที่เหลือจากโค้ดเดิมของคุณ ...*/
/* --- Header/Navbar --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
    font-family: var(--secondary-font);
}

.navbar-brand img {
    height: 90px;
    margin-right: 10px;
}

.navbar-toggle {
    display: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--ubru-pink);
    background: none;
    border: none;
}

.navbar-nav {
    list-style: none;
    display: flex;
    align-items: center;
}

.navbar-nav li {
    margin-left: 25px;
    position: relative;
}

.navbar-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--hover-color);
    transition: width 0.3s ease;
}

.navbar-nav a:hover {
    color: var(--hover-color);
}

.navbar-nav a:hover::after {
    width: 100%;
}

.navbar-search {
    margin-left: 25px;
}

.navbar-search button {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.navbar-search button:hover {
    color: var(--hover-color);
}

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    padding: 10px 0;
    border-radius: 5px;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: var(--background-light);
    color: var(--ubru-pink);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- Main Sections --- */
.hero-section {
    background-image: url('../images/ubru_student.png');
    /* ใส่รูปภาพ Hero ที่นี่ */
    background-size: cover;
    background-position: center;
    height: 73vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero-content h1 {
    font-size: 56px;
    margin-bottom: 15px;
    font-family: var(--secondary-font);
    font-weight: 700;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    font-weight: 400;
}

.about-section {
    padding: 80px 0;
    background-color: var(--background-light);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 18px;
}

.about-image {
    flex: 1;
    text-align: right;
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.programs-section {
    padding: 80px 0;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.program-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.program-card i {
    font-size: 50px;
    color: var(--ubru-pink);
    margin-bottom: 20px;
}

.program-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.news-section {
    padding: 80px 0;
    background-color: var(--background-light);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

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

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

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
}

.news-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--ubru-pink);
}

.news-content p {
    font-size: 16px;
    margin-bottom: 15px;
}

/* --- Footer --- */

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 20px;
    font-family: var(--secondary-font);
    color: #fff;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--ubru-pink);
}
hr {
    margin-top: 10px;
    margin-bottom: 10px;
    height: 2px;
    color: var(--ubru-pink);
}
.footer-col p,
.footer-col ul {
    font-size: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li a {
    color: #ecf0f1;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--ubru-pink);
}

.footer {
    background-color: #4a4a4a;
    /* โทนเทาเข้ม */
    color: #ecf0f1;
    padding: 60px 0 20px;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #6e6e6e;
    /* โทนเทากลาง */
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    color: #ecf0f1;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--ubru-pink);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #6e6e6e;
    /* โทนเทากลาง */
    padding-top: 20px;
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .navbar-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        padding: 10px 0;
        margin-top: 10px;
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-nav li {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-nav li:last-child {
        border-bottom: none;
    }

    .navbar-nav a {
        padding: 15px 20px;
        display: block;
        width: 100%;
    }

    .navbar-toggle {
        display: block;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        margin-top: 20px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 40px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .section-title {
        font-size: 30px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 20px;
    }

    .navbar-brand img {
        height: 35px;
    }

    .navbar-search {
        margin-left: 0;
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* --- Utility Classes (จากโค้ดเดิม) --- */
.conic-box-pink {
    /* ใช้สำหรับบาง section ที่ต้องการพื้นหลังเป็น conic-gradient */
    background: conic-gradient(from 180deg at 50% 50%,
            var(--ubru-pink) 0deg 90deg,
            var(--ubru-pink-light) 90deg 180deg,
            var(--ubru-pink-lighter) 180deg 270deg,
            var(--ubru-pink-light) 270deg 360deg);
}

/* --- Hero Section with Slideshow --- */
/* --- Hero Section with Video --- */
/* --- Hero Section and Slideshow --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 73vh;
    overflow: hidden;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Base style for all slides (image and video) */
.hero-slide,
.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

/* Active slide will be visible */
.hero-slide.active,
.hero-video-wrapper.active {
    opacity: 1;
}

/* Style for the video element itself */
.hero-video-wrapper video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1; /* Make sure video is behind the overlay */
}

.hero-section {
    position: relative;
    width: 100%;
    height: 73vh;
    overflow: hidden;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Base style for all slides (image and video) */
.hero-slide,
.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

/* Active slide will be visible */
.hero-slide.active,
.hero-video-wrapper.active {
    opacity: 1;
}

/* Style for the video element itself */
.hero-video-wrapper video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Overlay for text readability - ปรับแก้โค้ดส่วนนี้ */
/* หากไม่ต้องการให้มี Overlay เลย ให้ลบโค้ดส่วนนี้ออกทั้งหมด */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* ตั้งค่า alpha เป็น 0 เพื่อให้โปร่งใส */
    z-index: 2;
}

/* Overlay Content (title, description, link) */
.hero-overlay-content {
    position: relative;
    z-index: 3;
    padding: 20px;
    max-width: 800px;
    /* สามารถเปลี่ยนสีพื้นหลังของกล่องข้อความนี้แทนได้ */
    background-color: rgba(0, 0, 0, 0.4); 
    border-radius: 10px;
}

.hero-overlay-content h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-overlay-content p {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        height: 50vh;
    }
    .hero-overlay-content h3 {
        font-size: 2rem;
    }
    .hero-overlay-content p {
        font-size: 1.2rem;
    }
}



.hero-slide.active-slide {
    opacity: 1;
}



/* .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    background-color: rgba(0, 0, 0, 0);
   
    z-index: 2;
   
}  */


/* Overlay to make text readable */
/* Ensure overlay is on top of the images but below the content */

/*... ส่วน CSS อื่นๆ ที่เหลือจากโค้ดเดิมของคุณ ...*/
/* องค์ประกอบที่ซ้อนทับบนสไลด์ */
.hero-overlay-content {
    position: absolute;
    bottom: 50px;
    /* ปรับระยะห่างจากขอบด้านล่าง */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    /* วางไว้เหนือสไลด์ */
    text-align: center;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    /* พื้นหลังแบบใสๆ */
    padding: 20px 40px;
    border-radius: 10px;
    max-width: 80%;
    opacity: 0;
    /* ซ่อนไว้ตอนแรก */
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

/* แสดงส่วนเนื้อหาเมื่อนำเมาส์ไปชี้ที่ Hero Section */
.hero-section:hover .hero-overlay-content {
    opacity: 1;
    visibility: visible;
}

.hero-overlay-content h3 {
    margin-bottom: 5px;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-overlay-content p {
    margin: 0;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ปุ่มดูรายละเอียดเพิ่มเติม */
.hero-overlay-content .cta-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 25px;
    background-color: transparent;
    /* เริ่มต้นเป็นแบบใส */
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* เปลี่ยนสีปุ่มเมื่อนำเมาส์ไปชี้ */
.hero-overlay-content .cta-button:hover {
    background-color: var(--ubru-pink);
    /* ใช้สีชมพูตามธีม */
    border-color: var(--ubru-pink);
}

/*
    ส่วน CSS ที่มีอยู่แล้ว สามารถเก็บไว้ได้ตามเดิม
    แต่ให้เพิ่มและแก้ไขส่วนที่เกี่ยวข้องกับ `.search-container`
*/

.navbar-search {
    position: relative;
    /* สำคัญ: เพื่อให้ search-container อ้างอิงตำแหน่งได้ */
    margin-left: 25px;
}

.search-container {
    display: none;
    /* ซ่อนช่องค้นหาไว้ตอนแรก */
    position: absolute;
    top: 100%;
    /* แสดงอยู่ด้านล่างของปุ่มค้นหา */
    right: 0;
    width: 250px;
    /* กำหนดความกว้างของช่องค้นหา */
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    z-index: 1001;
    /* ทำให้ลอยอยู่ด้านบนของเนื้อหาอื่นๆ */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.search-container.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
}

.program-card {
    cursor: pointer;
}

a .program-card {
    color: var(--text-color) !important;
}

a .program-card:hover {
    color: var(--ubru-pink) !important;
}

.dev {
    font-size: 10px;

}


/* โค้ด CSS พื้นฐานของ Popover (ตามที่ให้ไปก่อนหน้า) */
.popover-trigger {
    position: relative;
}

.popover-content {
    visibility: hidden;
    width: 250px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

/* --- กำหนดตำแหน่ง Popover --- */

/* สำหรับแสดงทางซ้าย */
.popover-trigger.left .popover-content {
    top: 50%;
    right: 110%;
    /* กำหนดให้อยู่ทางขวาของ trigger 110% */
    transform: translateY(-50%);
    /* จัดกึ่งกลางในแนวตั้ง */
}

/* Arrow ของ Popover */
.popover-trigger.left .popover-content::after {
    top: 50%;
    left: 100%;
    /* กำหนดให้อยู่ทางซ้ายสุดของ Popover */
    margin-top: -5px;
    /* จัดกึ่งกลางในแนวตั้ง */
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #555;
    /* เปลี่ยนทิศทางลูกศรให้ชี้ไปทางซ้าย */
}