/* ===== BASIC STYLES ===== */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* ===== [แก้ไข] เพิ่มโค้ดล็อกการเลื่อน ===== */
body.no-scroll {
    overflow: hidden;
}

/* ===== [ใหม่] ENTRY OVERLAY & BLUR ===== */
#entry-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* ข้อความบน Overlay */
.entry-content {
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-family: 'Orbitron', sans-serif;
    animation: fadeInUp 1s ease-out;
}
.entry-content h1 {
     font-size: 3rem;
     margin-bottom: 10px;
}
.entry-content p {
     font-size: 1.5rem;
     font-family: 'Rajdhani', sans-serif;
     animation: pulse 2s ease-in-out infinite;
}

/* ตัวห่อเว็บหลัก */
#main-site-wrapper {
    transition: filter 0.5s ease-out;
}

/* Class ที่ใช้เบลอเว็บ */
.blurred {
    filter: blur(10px) brightness(0.7);
    pointer-events: none; 
    user-select: none;
}
/* ===== จบส่วน ENTRY OVERLAY ===== */


/* ===== VIDEO BACKGROUND ===== */
.video-background {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;  
    height: 100vh; 
    z-index: -2;   
    overflow: hidden;
}

#bgVideo {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center center;
    filter: contrast(1.1) brightness(1.05);
    image-rendering: crisp-edges;
}

.video-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: -1;
    animation: pulse 4s ease-in-out infinite;
}


/* ===== MASCOT ===== */
.mascot {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.mascot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: mascotFloat 3s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.mascot.scrolled {
    top: 20px;
    left: 30px;
    transform: translateX(0) scale(0.8);
}

.mascot:hover img {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 40px rgba(79, 195, 247, 0.6);
    border-color: rgba(79, 195, 247, 0.8);
}


/* ===== VISITOR COUNTER ===== */
.visitor-counter {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    animation: slideInRight 1s ease-out;
}

.counter-box {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    padding: 18px 28px;
    border-radius: 20px;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    min-width: 170px;
    text-align: center;
    overflow: hidden;
    transform: translateY(0px);
    animation: floatUp 3s ease-in-out infinite;
    box-shadow: 
        0 10px 35px rgba(79, 195, 247, 0.35),
        inset 0 0 30px rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.counter-box:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 45px rgba(79, 195, 247, 0.5),
        inset 0 0 40px rgba(255, 255, 255, 0.2);
}

.counter-box::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        rgba(79, 195, 247, 0.5),
        rgba(179, 157, 219, 0.5),
        rgba(79, 195, 247, 0.5)
    );
    animation: spinGlow 6s linear infinite;
    filter: blur(80px);
    z-index: -1;
}

.count-number {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1.5px;
    text-shadow: 
        0 0 10px rgba(79, 195, 247, 0.8),
        0 0 20px rgba(79, 195, 247, 0.6);
    animation: numberPulse 2s ease-in-out infinite;
}

.count-label {
    font-family: 'Rajdhani', sans-serif;
    margin-top: 6px;
    font-size: 1rem;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

/* Status Indicator */
.status-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #00ff88, #00cc6f);
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    animation: pulse 2s ease-in-out infinite;
}


/* ===== CONTENT CONTAINER ===== */
.content {
    position: relative; 
    z-index: 1; 
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; 
    text-align: center;
    padding: 20px;
}


/* ===== HEADER ===== */
header {
    animation: fadeInUp 1s ease-out;
    margin-top: 200px;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 3.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #fff, #4fc3f7, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1.2s ease-out, gradientShift 3s ease infinite;
    text-shadow: 0 0 20px rgba(79, 195, 247, 0.5),
                 0 0 40px rgba(79, 195, 247, 0.3);
}

header p {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: 1px;
    animation: fadeInUp 1.4s ease-out;
}


/* ===== MAIN CONTENT ===== */
main {
    margin-top: 50px;
    max-width: 800px;
    width: 100%;
}


/* ===== SECTIONS ===== */
section {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3);
}

section h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    color: #fff;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4fc3f7, #b39ddb);
    transition: width 0.5s ease;
}

section:hover h2::after {
    width: 100%;
}

section p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ===== [แก้ไข] Section Animation Delays ===== */
#about {
    animation-delay: 0.2s;
}

#contact {
    animation-delay: 0.4s;
}

#stream {
    animation-delay: 0.6s;
}

#support {
    animation-delay: 0.8s;
}
/* ===== จบส่วนแก้ไข ===== */


/* ===== ARTICLES ===== */
article {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    opacity: 0;
    animation: fadeInLeft 0.6s ease-out forwards;
    transition: all 0.3s ease;
}

article:nth-child(odd) {
    animation: fadeInLeft 0.6s ease-out forwards;
}

article:nth-child(even) {
    animation: fadeInRight 0.6s ease-out forwards;
}

article:hover {
    transform: translateX(10px) scale(1.02);
    background-color: rgba(79, 195, 247, 0.2);
}

article h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4fc3f7;
    margin-bottom: 10px;
}

/* Article Animation Delays */
article:nth-child(1) {
    animation-delay: 0.5s;
}

article:nth-child(2) {
    animation-delay: 0.7s;
}

article:nth-child(3) {
    animation-delay: 0.9s;
}


/* ===== SOCIAL LINKS ===== */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 100px;
}

.social-icon svg {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.social-icon span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.social-icon:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.social-icon:hover svg {
    transform: scale(1.2) rotate(5deg);
}

/* Social Icon Colors */
/* (สังเกตว่า nth-child เปลี่ยนไปตาม Section ใหม่) */
/* Section "Contact" */
.social-icon:nth-child(1):hover { /* GitHub */
    background: linear-gradient(135deg, #333, #666);
}
.social-icon:nth-child(2):hover { /* Discord */
    background: linear-gradient(135deg, #5865f2, #7289da);
}
.social-icon:nth-child(3):hover { /* LinkedIn */
    background: linear-gradient(135deg, #0077B5, #00A0DC);
}
.social-icon:nth-child(4):hover { /* Instagram */
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}
.social-icon:nth-child(5):hover { /* Facebook */
    background: linear-gradient(135deg, #1877F2, #3b5998);
}
.social-icon:nth-child(6):hover { /* Roblox */
    background: linear-gradient(135deg, #DE0000, #A00000);
}

#stream .social-icon:nth-child(1):hover { /* YouTube */
    background: linear-gradient(135deg, #ff0000, #cc0000);
}
#stream .social-icon:nth-child(2):hover { /* TikTok */
    background: linear-gradient(135deg, #ff0050, #00f2ea);
}
#stream 

/* Section "Support" (นับ 1 ใหม่) */
#support .social-icon:nth-child(1):hover { /* TipMe */
    background: linear-gradient(135deg, #FFC107, #FF9800);
}


/* ===== SONG SECTION & CUSTOM AUDIO PLAYER ===== */
/* (โค้ดที่แก้ไขล่าสุด: แถบใหญ่ + ไม่มีปุ่ม next/prev) */

#song {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 1.0s; /* [แก้ไข] หน่วงเวลาเพิ่มเป็น 1.0s */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center; 
}

#song:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3);
}

#song h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 1.5px;
    margin-bottom: 25px; 
    color: #fff;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

#song h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4fc3f7, #b39ddb);
    transition: width 0.5s ease;
}

#song:hover h2::after {
    width: 100%;
}

/* ซ่อน Player เริ่มต้น */
#song audio {
    display: none;
}

/* กรอบ Player ที่สร้างเอง */
.custom-player-container {
    max-width: 600px;
    margin: 0 auto; 
    background: rgba(30, 30, 50, 0.5); 
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* รูปปกอัลบั้ม */
.player-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.track-info {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-align: left; 
}

.controls-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.time-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #ccc;
    min-width: 40px; 
    text-align: center;
}

/* แถบ Progress Bar (ใหญ่ขึ้น) */
.progress-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px; 
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px; 
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.progress-bar:hover {
    height: 12px; 
}

/* ปุ่มกลมๆ ที่ใช้ลาก */
.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; 
    height: 18px; 
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px; 
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.progress-bar:hover::-webkit-slider-thumb {
     margin-top: -3px; 
}

.progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}


/* ปุ่มควบคุม (Play, Prev, Next) */
.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

.control-btn:hover {
    color: #4fc3f7; 
    transform: scale(1.1);
}

.control-btn.play-pause svg {
    width: 30px; 
    height: 30px;
}

/* ซ่อนปุ่ม Prev/Next */
#prev-btn,
#next-btn {
    display: none;
}


/* สไตล์สำหรับปุ่มควบคุมเสียง */
.volume-controls {
    display: flex;
    align-items: center;
    gap: 5px; 
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px; 
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider:hover {
    height: 7px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4.5px; 
}

.volume-slider:hover::-webkit-slider-thumb {
     margin-top: -3.5px; 
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
/* ===== จบส่วนของ SONG PLAYER ===== */


/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes mascotFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes floatUp {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes spinGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Header */
    header {
        margin-top: 120px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1.2rem;
    }
    
    /* Mascot */
    .mascot {
        width: 120px;
        height: 120px;
    }
    
    .mascot.scrolled {
        left: 15px;
        transform: translateX(0) scale(0.7);
    }
    
    /* Visitor Counter */
    .visitor-counter {
        top: 10px;
        right: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .counter-box {
        min-width: 140px;
        padding: 12px 20px;
    }
    
    .count-number {
        font-size: 1.8rem;
    }
    
    .count-label {
        font-size: 0.85rem;
    }
    
    /* Social Links */
    .social-links {
        gap: 15px;
    }
    
    .social-icon {
        min-width: 80px;
        padding: 15px;
    }
    
    .social-icon svg {
        width: 30px;
        height: 30px;
    }
    
    /* Responsive สำหรับ Custom Player */
    .custom-player-container {
        flex-direction: column; 
        gap: 12px;
        padding: 12px;
    }

    .player-art {
        width: 48px; 
        height: 48px;
        border-radius: 6px;
    }

    .player-right {
        gap: 12px;
        width: 100%; 
    }

    .track-info {
        text-align: center; 
        font-size: 1rem;
    }

    .controls-wrapper {
        gap: 8px;
        flex-wrap: wrap; 
        justify-content: center;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .control-btn.play-pause svg {
        width: 28px;
        height: 28px;
    }

    .time-display {
        font-size: 0.8rem;
        min-width: 35px;
    }

    .progress-bar {
        height: 8px; 
        order: -1; 
        width: 100%;
    }
    
    .progress-bar::-webkit-slider-thumb {
        width: 16px; 
        height: 16px; 
        margin-top: -4px; 
    }
    
    .progress-bar::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }

    /* Responsive สำหรับ Volume */
    .volume-controls {
        gap: 8px;
    }
    .volume-slider {
        width: 80px; 
    }
    
    /* Responsive สำหรับ Overlay */
    .entry-content h1 {
        font-size: 2rem;
    }
    .entry-content p {
        font-size: 1.2rem;
    }
}