/* --- 1. RESET & GLOBAL FONTS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden; /* ป้องกันสกรอลล์แนวนอน */
}

/* --- 2. NAVBAR (เมนูด้านบน) --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 31, 63, 0.95); /* สีพื้นหลังเมนู */
    backdrop-filter: blur(10px);
    z-index: 1000; /* อยู่เหนือเนื้อหาปกติ แต่อยู่ใต้ Modal */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 40px; /* บังคับความสูงโลโก้ใน CSS อีกทาง */
    width: auto;
    margin-right: 12px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

/* --- 3. HERO SECTION (วิดีโอหน้าแรก) --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.back-video {
    position: absolute;
    right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    z-index: -1;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 20px;
    max-width: 1200px;
}

.hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 64px; 
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
    text-shadow: 3px 3px 15px rgba(0,0,0,0.6);
}

.hero-content p {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px; 
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 15px;
    opacity: 1;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    color: #e0f7fa;
}

/* --- 4. CONTENT CONTAINER (พื้นหลังใต้น้ำ) --- */
.content-container {
    position: relative;
    background: url('picture/underwater.jpg') no-repeat center top; /* Path รูปพื้นหลัง */
    background-size: cover;
    background-attachment: fixed;
    padding: 80px 50px;
    min-height: 100vh;
}

.content-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 20, 40, 0.85); /* สีทับหน้าให้มืดลง */
    z-index: 0;
}

.content-container > * { position: relative; z-index: 1; }

/* --- 5. HEADINGS (หัวข้อ) --- */
.section-title {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    margin-bottom: 40px;
    margin-top: 60px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px; height: 4px;
    background: #3498db;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- 6. ABSTRACT BOX --- */
.abstract-box {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.abstract-box p {
    font-size: 16px;
    line-height: 1.8;
    color: #e0e0e0;
    text-align: justify;
}

/* --- 7. MAIN CONTENT (กล่อง Download/Link) --- */
.resource-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
}
.resource-box {
    background: #001f3f;
    width: 300px;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #3498db;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.resource-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
    background: #002b55;
}
.icon-wrapper {
    width: 80px; height: 80px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.icon-img { width: 50px; height: auto; }
.resource-box h3 { font-size: 20px; margin-bottom: 10px; font-family: 'Montserrat', sans-serif; }
.resource-box p { font-size: 14px; color: #aaa; }

/* --- 8. TEAM MEMBERS --- */
.team-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.member-card {
    width: 280px;
    background: rgba(0, 31, 63, 0.6);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s;
    border: 1px solid rgba(52, 152, 219, 0.3);
}
.member-card:hover { transform: translateY(-5px); background: rgba(0, 31, 63, 0.8); }
.img-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 3px solid #3498db;
}
.img-circle img { width: 100%; height: 100%; object-fit: cover; }
.role-blue { color: #3498db; font-size: 16px; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; }
.name-white { color: #fff; font-size: 18px; font-weight: 600; }

/* --- 9. WORKFLOW SLIDER --- */
.workflow-slider {
    max-width: 900px; margin: 0 auto;
    position: relative;
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}
.slider-container { position: relative; width: 100%; }
.slide { display: none; text-align: center; }
.caption { margin-top: 10px; font-style: italic; color: #ccc; font-size: 14px; }
.prev, .next {
    cursor: pointer;
    position: absolute; top: 50%;
    width: auto; margin-top: -22px;
    padding: 16px;
    color: white; font-weight: bold; font-size: 20px;
    transition: 0.3s ease;
    border-radius: 3px;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
}
.next { right: 0; }
.prev { left: 0; }
.prev:hover, .next:hover { background-color: rgba(52, 152, 219, 0.8); }
.dot {
    cursor: pointer; height: 12px; width: 12px;
    margin: 0 4px;
    background-color: #717171;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s;
}
.active, .dot:hover { background-color: #3498db; }
.fade { animation-name: fade; animation-duration: 1.5s; }
@keyframes fade { from {opacity: .4} to {opacity: 1} }

/* --- 10. MODAL (POP-UP รูปภาพ) --- */
/* แก้ไขล่าสุด: ปรับ z-index และขนาดให้ถูกต้อง */
.modal {
    display: none; 
    position: fixed; 
    z-index: 99999; /* 🔥 เลขเยอะๆ เพื่อให้อยู่บนสุด ทับเมนู Navbar */
    padding-top: 30px; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95); /* สีพื้นหลังมืดๆ */
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto; 
    display: block;
    width: auto; 
    max-width: 90%; 
    max-height: 85vh; /* 🔥 จำกัดความสูงรูปไม่ให้เกินจอ */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 2px solid #333;
}

#caption-text {
    margin: auto; 
    display: block; 
    width: 80%;
    text-align: center; 
    color: #fff;
    padding: 15px 0; 
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
}

/* ปุ่มปิด (X) */
.close {
    position: fixed; /* ลอยอยู่ติดหน้าจอ ไม่เลื่อนตาม */
    top: 20px; 
    right: 30px;
    color: #fff; 
    font-size: 35px;
    font-weight: bold; 
    cursor: pointer;
    z-index: 100000; /* อยู่เหนือรูปภาพ */
    background: rgba(255, 255, 255, 0.1);
    width: 50px; height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    transition: 0.3s;
}

.close:hover { 
    color: #fff; 
    background: #e74c3c; /* เมาส์ชี้เป็นสีแดง */
    transform: rotate(90deg);
}

/* --- 11. JELLYFISH ANIMATION (แมงกะพรุน) --- */
.jellyfish {
    position: fixed;
    width: 120px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.5));
    mix-blend-mode: multiply; 
}

.jelly-1 {
    bottom: 10%;
    left: -150px;
    animation: swimRight 25s linear infinite;
}

.jelly-2 {
    top: 20%;
    right: -150px;
    animation: swimLeft 30s linear infinite;
    animation-delay: 2s;
}

@keyframes swimRight {
    0% { left: -150px; transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(30px) rotate(-5deg); }
    100% { left: 100vw; transform: translateY(0); } 
}

@keyframes swimLeft {
    0% { right: -150px; transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(40px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-40px) rotate(5deg); }
    100% { right: 100vw; transform: translateY(0); }
}

/* --- 12. RESPONSIVE DESIGN (สำหรับมือถือ) --- */
@media screen and (max-width: 768px) {
    .jellyfish { display: none; /* ซ่อนแมงกะพรุนในมือถือ */ }
    
    .navbar { padding: 15px; flex-direction: column; gap: 10px; }
    .hero-content h1 { font-size: 36px; } 
    .hero-content p { font-size: 18px; }  
    
    .resource-container, .team-container { flex-direction: column; align-items: center; }
    
    .modal-content { width: 95%; max-height: 70vh; margin-top: 20%; }
    .close { top: 10px; right: 10px; width: 40px; height: 40px; line-height: 40px; font-size: 25px; }
}