* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans Thai', 'Arial', sans-serif;
}

body {
    background: #0a0a1a; /* Dark black background */
    height: 100vh;
    overflow-y: auto;
    position: relative;
}
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.8); /* Semi-transparent dark overlay */
    z-index: 9999; /* Above all other elements */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Blurred background effect */
    animation: fadeOut 1.5s 2s forwards; /* Fade out after 2 seconds */
}
.dots-container {
    display: flex;
    gap: 10px;
}

.dot {
    width: 15px;
    height: 15px;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border-radius: 50%;
    animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
.dot:nth-child(4) { animation-delay: 0.6s; }
.dot:nth-child(5) { animation-delay: 0.8s; }

.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('background.jpg') no-repeat center center/cover;
    filter: blur(10px);
    opacity: 1;
    z-index: 1;
    transition: opacity 1s ease-out;
}

.initial-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.logo-container {
    position: relative;
    text-align: center;
    animation: scaleUp 1.5s ease-out;
}

.logo {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(42, 82, 152, 0.8));
    animation: glow 2s infinite alternate;
}

.typing-container {
    margin-top: 20px;
    text-align: center;
}

.typing-text {
    color: #fff;
    font-size: 2.5em;
    text-shadow: 0 0 15px rgba(74, 110, 169, 0.8);
}

.cursor {
    display: inline-block;
    width: 5px;
    height: 1.2em;
    background: #fff;
    animation: blink 0.7s infinite;
    vertical-align: bottom;
}

.enter-button {
    margin-top: 40px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(74, 110, 169, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.enter-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(74, 110, 169, 0.9);
}

.main-content {
    display: none; /* Hidden initially */
    position: relative;
    z-index: 2;
}

.container {
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 1s 0.5s forwards; /* Fade in after button click */
}

h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(74, 110, 169, 0.8);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.member-card {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(74, 110, 169, 0.8);
    text-align: center;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(74, 110, 169, 0.5);
    position: relative; /* คงไว้เพื่อให้ ::before ทำงาน */
    overflow: hidden;
    z-index: 1; /* เพิ่ม z-index เพื่อกำหนดระดับพื้นฐาน */
}

.member-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 110, 169, 0.2), transparent);
    animation: lightPulse 4s infinite alternate;
    z-index: -1; /* วาง ::before ไว้ด้านหลังเนื้อหา เพื่อไม่ให้ทับลิงก์ */
    pointer-events: none; /* ป้องกัน ::before รับการคลิก */
}

.member-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px rgba(74, 110, 169, 0.9);
}

.member-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 0 15px rgba(74, 110, 169, 0.8);
    filter: drop-shadow(0 0 10px rgba(42, 82, 152, 0.5));
    position: relative; /* เพิ่มเพื่อให้แน่ใจว่ารูปอยู่ด้านหน้า */
    z-index: 2; /* วางรูปด้านหน้า */
}

.member-card h3, .member-card p {
    margin: 10px 0;
    font-size: 1em;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    position: relative; /* เพิ่มเพื่อให้ข้อความอยู่ด้านหน้า */
    z-index: 2; /* วางข้อความด้านหน้า */
}

.social-links {
    margin-top: 15px;
    position: relative; /* เพิ่มเพื่อให้ลิงก์อยู่ด้านหน้า */
    z-index: 3; /* วางลิงก์ด้านหน้าสุด */
}

.social-links a {
    display: inline-block;
    margin: 0 10px;
    font-size: 24px;
    text-decoration: none;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.2);
}


.contact-button {
    display: block;
    margin: 40px auto;
    padding: 12px 25px;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(74, 110, 169, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(74, 110, 169, 0.9);
}

#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#background-music {
    display: none; /* Hide the audio element */
}

@media (max-width: 768px) {
    .logo {
        width: 200px;
    }
    .loading {
        backdrop-filter: blur(3px); /* Lighter blur on mobile */
    }
    .dot {
        width: 12px;
        height: 12px;
    }
    .typing-text, .cursor {
        font-size: 1.8em;
    }

    .enter-button {
        padding: 10px 20px;
        font-size: 1em;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .member-img {
        width: 100px;
        height: 100px;
    }

    .member-card h3, .member-card p {
        font-size: 0.9em;
    }

    .social-links a {
        font-size: 1em;
    }

    .contact-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(42, 82, 152, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(42, 82, 152, 0.8)); }
}

@keyframes lightPulse {
    from { transform: scale(1); opacity: 0.5; }
    to { transform: scale(1.1); opacity: 0.2; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes fadeOutBlur {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes glowTab {
    from { box-shadow: 0 0 10px rgba(74, 110, 169, 0.6); }
    to { box-shadow: 0 0 20px rgba(74, 110, 169, 0.9); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

::-webkit-scrollbar {
    width: 12px; /* Width of the scrollbar */
    height: 12px; /* Height of the horizontal scrollbar */
}

::-webkit-scrollbar-track {
    background: #000; /* Black track background */
    border-radius: 10px; /* Rounded corners for the track */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #1e3c72, #2a5298); /* Gradient thumb matching your logo */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid #000; /* Optional border for contrast */
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #2a5298, #4a6ea9); /* Darker gradient on hover */
    box-shadow: 0 0 10px rgba(74, 110, 169, 0.8); /* Glowing effect on hover */
}