/* สไตล์พื้นฐานทั่วไป - Dark Theme */
:root {
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-purple: #9d4edd;
    --accent-blue: #7b2cbf;
    --text-light: #e2e2e2;
    --text-dim: #a0a0a0;
    --gradient-purple-blue: linear-gradient(135deg, #7b2cbf 0%, #3a0ca3 50%, #4361ee 100%);
    --card-bg: rgba(26, 26, 46, 0.7);
    --glass-effect: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(123, 44, 191, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', 'Prompt', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--primary-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(107, 73, 179, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(67, 97, 238, 0.1) 0%, transparent 50%);
    transition: all 0.3s ease;
}

a {
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

img:hover, video:hover {
    transform: scale(1.02);
}

/* Header และ Navigation */
header {
    background-color: rgba(22, 33, 62, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ปรับปรุงส่วนของโลโก้ให้เป็นวงกลมพร้อมเอฟเฟค glow */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-purple);
    margin-right: 15px;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.6);
    transition: all 0.3s ease;
}

.logo img:hover {
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
    transform: scale(1.05);
}

.logo-text {
    font-weight: bold;
    color: var(--text-light);
    font-size: 18px;
    background: linear-gradient(to right, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.3);
}

/* จัดการเมนูกับไอคอน */
.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    margin: 0 15px;
}

.menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
}

.menu a:hover {
    background-color: var(--glass-effect);
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.menu a.active {
    color: var(--accent-purple);
    background-color: rgba(123, 44, 191, 0.1);
    box-shadow: inset 0 0 5px rgba(123, 44, 191, 0.2);
}

.menu a i {
    font-size: 24px;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.menu a:hover i {
    transform: translateY(-3px);
}

.menu-text {
    font-size: 12px;
    opacity: 0.9;
}

.menu a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: var(--gradient-purple-blue);
    border-radius: 10px;
}

/* ส่วน Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

section {
    margin-bottom: 3.5rem;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--shadow-color);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-color), var(--shadow-glow);
}

h1, h2, h3 {
    color: var(--text-light);
    margin-bottom: 1.2rem;
    position: relative;
    display: inline-block;
}

h1::after, h2::after, h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40%;
    height: 3px;
    background: var(--gradient-purple-blue);
    border-radius: 10px;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--gradient-purple-blue);
    color: white;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 50px rgba(123, 44, 191, 0.5);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeIn 0.5s ease forwards, typing 3s steps(30) 0.5s forwards;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    display: inline-block;
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 0.5s ease 3.5s forwards, typing 2.5s steps(40) 3.5s forwards;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    display: inline-block;
}

/* ปุ่มทั่วไป */
.btn {
    display: inline-block;
    background: var(--gradient-purple-blue);
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 15px rgba(123, 44, 191, 0.5);
    z-index: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.6);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(1px);
}

.view-more {
    text-align: center;
    margin-top: 2.5rem;
}

/* ส่วน Footer */
footer {
    background-color: rgba(22, 33, 62, 0.9);
    color: var(--text-dim);
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gradient-purple-blue);
    opacity: 0.5;
}

/* การ์ดแบบแก้วโปร่งใส */
.glass-card {
    background-color: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.7s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.glass-card:hover::before {
    left: 100%;
}

/* Modal สำหรับรูปภาพและวิดีโอ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.95);
    overflow: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 30px;
    width: 80%;
    max-width: 1000px;
    animation: zoom 0.4s ease;
    background-color: rgba(26, 26, 46, 0.6);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(123, 44, 191, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

@keyframes zoom {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 30px;
    color: var(--text-light);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(26, 26, 46, 0.7);
}

.close-modal:hover {
    color: var(--accent-purple);
    transform: rotate(90deg);
}

.modal-caption {
    margin: 20px 0;
    color: var(--text-light);
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.9;
}

#modalImage, #modalVideo {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* แอนิเมชั่นแบบพิมพ์ดีด */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}

/* เพิ่มเส้นกระพริบหลังข้อความเหมือนการพิมพ์ดีด */
.hero h1::after,
.hero p::after {
    content: '|';
    display: inline-block;
    color: white;
    animation: blink 1s step-end infinite;
    position: static;
    width: auto;
    height: auto;
    background: none;
}

@keyframes blink {
    from, to { opacity: 1 }
    50% { opacity: 0 }
}

/* เพิ่มเอฟเฟกต์ลูกคลื่นเบาๆ บนพื้นหลัง */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, 
        rgba(154, 198, 252, 0), 
        rgba(197, 169, 249, 0.8) 50%, 
        rgba(154, 198, 252, 0) 100%);
    animation: wave 8s linear infinite;
    filter: blur(2px);
}

@keyframes wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* เพิ่ม scrollbar แบบสวยงาม */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-purple), var(--accent-blue));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--accent-blue), var(--accent-purple));
}

/* เอฟเฟคเรืองแสงสำหรับข้อความสำคัญ */
.glow-text {
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.7);
}

/* Motion Parallax Effects */
.parallax-container {
    position: relative;
    overflow: hidden;
    height: 300px; /* ปรับความสูงตามต้องการ */
    border-radius: 16px;
    margin: 2rem 0;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-image: var(--gradient-purple-blue);
    transform: translateZ(0);
    z-index: 1;
}

.parallax-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
}

/* Custom Switch Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 26, 46, 0.6);
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-light);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gradient-purple-blue);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Media Queries */
@media screen and (max-width: 768px) {
    nav {
        flex-direction: column;
    }
    
    .menu {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu li {
        margin: 0 0.5rem;
    }
    
    .menu-text {
        display: none; /* ซ่อนข้อความและแสดงเฉพาะไอคอนบนมือถือ */
    }
    
    .menu a {
        padding: 8px;
    }
    
    .menu a i {
        font-size: 20px;
        margin-bottom: 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .glass-card {
        padding: 15px;
    }
    
    .parallax-container {
        height: 200px;
    }
}

@media screen and (max-width: 480px) {
    .hero {
        padding: 2.5rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    section {
        padding: 15px;
    }
    
    .btn {
        padding: 0.7rem 1.4rem;
    }
}