/* css/global.css */
:root {
    --primary: #081C2E;
    --secondary: #0E3A5F;
    --accent: #00C2FF;
    --highlight: #00F0FF;
    --text: #EAF6FF;
    --text-muted: #A0C4E2;
    --glass-bg: rgba(14, 58, 95, 0.2);
    --glass-border: rgba(0, 194, 255, 0.2);
    --transition: all 0.3s ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Kanit', 'Segoe UI', Tahoma, sans-serif; }
html { scroll-behavior: smooth; }
body { background: linear-gradient(135deg, var(--primary), var(--secondary)); background-attachment: fixed; color: var(--text); overflow-x: hidden; line-height: 1.6; }

/* Utilities */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.section-padding { padding: 100px 0; }
.text-center { text-align: center; }
.text-highlight { color: var(--highlight); }
.text-accent { color: var(--accent); }
.mb-4 { margin-bottom: 2rem; }

/* Background Grid Overlay */
.grid-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(0, 194, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 194, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px; z-index: -2; pointer-events: none;
}

/* Glassmorphism Base */
.glass-panel {
    background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 16px; padding: 2rem; transition: var(--transition);
}
.glass-panel:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(0, 194, 255, 0.2); transform: translateY(-5px); }

/* Page Header (ใช้ร่วมกันใน About, Contact) */
.page-header { padding: 150px 0 50px; text-align: center; position: relative; }

/* Navbar */
.navbar { position: fixed; top: 0; left: 0; width: 100%; padding: 20px 0; z-index: 1000; transition: var(--transition); }
.navbar.scrolled { background: rgba(8, 28, 46, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--glass-border); padding: 15px 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links li a { color: var(--text); text-decoration: none; font-size: 1rem; position: relative; padding-bottom: 5px; transition: var(--transition); }
.nav-links li a:hover { color: var(--highlight); }

/* Language Switcher */
.lang-switcher { display: flex; gap: 12px; align-items: center; margin-left: 30px; padding-left: 20px; border-left: 1px solid var(--glass-border); }
.lang-switcher a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 600; transition: var(--transition); }
.lang-switcher a.active, .lang-switcher a:hover { color: var(--highlight); text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.lang-switcher span { color: var(--glass-border); }

/* Buttons */
.btn { display: inline-block; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: var(--transition); cursor: pointer; border: none; }
.btn-neon { background: transparent; color: var(--highlight); border: 2px solid var(--highlight); }
.btn-neon:hover { background: var(--highlight); color: var(--primary); box-shadow: 0 0 20px var(--highlight); }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--highlight)); color: var(--primary); }
.btn-primary:hover { box-shadow: 0 0 20px var(--accent); transform: scale(1.05); }

/* Footer */
footer { background: #05121e; padding: 50px 0 20px; border-top: 1px solid var(--glass-border); }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 30px; }
.social-icons { display: flex; gap: 15px; }
.social-icons svg { width: 24px; height: 24px; fill: var(--text-muted); transition: var(--transition); cursor: pointer; }
.social-icons svg:hover { fill: var(--highlight); filter: drop-shadow(0 0 5px var(--highlight)); transform: translateY(-3px); }

/* Animations */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .nav-links, .lang-switcher { display: none; }
}

/* =========================================
   NAVBAR & HEADER STYLES
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    background: rgba(8, 28, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 0; /* เล็กลงเมื่อเลื่อนหน้าจอ */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navbar Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* ตั้งค่าขนาดรูปภาพโลโก้ */
.logo-img {
    height: 100px; /* ปรับความสูงของโลโก้ตามความเหมาะสม */
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

/* เอฟเฟกต์เรืองแสงเมื่อเอาเมาส์ชี้โลโก้ */
.logo:hover .logo-img {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8));
    transform: scale(1.05);
}

/* หากคุณเปิดใช้ข้อความคู่กับรูปภาพ (logo-text) */
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* -- Menu Area -- */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 35px; /* ระยะห่างระหว่างเมนู */
    margin: 0;
    padding: 0;
}

.nav-links li a {
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

/* เส้นขีดเส้นใต้ตอน Hover เมนู */
.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--highlight);
    box-shadow: 0 0 8px var(--highlight);
    transition: width 0.3s ease;
}

.nav-links li a:hover {
    color: var(--highlight);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* -- Language Switcher -- */
.lang-switcher {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: 35px; /* ห่างจากเมนูตัวสุดท้าย */
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.15); /* เส้นคั่นบางๆ */
    height: 24px;
}

.lang-switcher a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.lang-switcher a.active {
    color: var(--highlight);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.lang-switcher a:hover:not(.active) {
    color: #fff;
}

/* -- Responsive (Mobile) -- */
@media (max-width: 992px) {
    .nav-menu-wrapper {
        display: none; /* ซ่อนเมนูบนมือถือไปก่อน (ต้องทำ Hamburger menu เพิ่มหากต้องการ) */
    }
}

/* =========================================
   HAMBURGER MENU — เพิ่มใน global.css
   แทนที่ @media (max-width: 992px) เดิม
   ========================================= */
 
/* -- Hamburger Button -- */
.hamburger {
    display: none; /* ซ่อนบน Desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 5px;
    z-index: 1100;
    border-radius: 8px;
    transition: background 0.2s ease;
}
 
.hamburger:hover {
    background: rgba(0, 194, 255, 0.1);
}
 
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
 
/* State: เปิด menu → แปลงเป็น X */
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--highlight);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--highlight);
}
 
/* -- Mobile Nav Overlay -- */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 18, 30, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
 
.mobile-nav-overlay.active {
    opacity: 1;
}
 
/* -- Mobile Nav Drawer -- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100dvh;
    background: rgba(8, 28, 46, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    padding: 80px 32px 40px;
    gap: 8px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}
 
.mobile-nav.active {
    right: 0;
}
 
/* Neon accent strip ด้านซ้ายของ Drawer */
.mobile-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--highlight), transparent);
    opacity: 0.6;
}
 
/* -- Mobile Nav Links -- */
.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 10px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    letter-spacing: 0.3px;
}
 
.mobile-nav a:hover,
.mobile-nav a.active-page {
    color: var(--highlight);
    background: rgba(0, 194, 255, 0.08);
    border-color: rgba(0, 194, 255, 0.2);
    padding-left: 22px;
}
 
/* Divider ก่อน Language Switcher */
.mobile-nav-divider {
    height: 1px;
    background: rgba(0, 194, 255, 0.12);
    margin: 12px 0;
}
 
/* -- Mobile Language Switcher -- */
.mobile-lang-switcher {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    align-items: center;
}
 
.mobile-lang-switcher a {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(0, 194, 255, 0.2) !important;
    transition: all 0.25s ease !important;
}
 
.mobile-lang-switcher a.active,
.mobile-lang-switcher a:hover {
    color: var(--highlight) !important;
    background: rgba(0, 240, 255, 0.1) !important;
    border-color: var(--highlight) !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
 
/* -- Responsive Breakpoint -- */
@media (max-width: 992px) {
    /* ซ่อน Desktop Menu */
    .nav-menu-wrapper {
        display: none;
    }
 
    /* แสดง Hamburger */
    .hamburger {
        display: flex;
    }
 
    /* ปรับขนาด Logo บน Mobile */
    .logo-img {
        height: 60px;
    }
}