:root {
    /* --- โทนสีใหม่ ทอง-ดำ --- */
    --gold-primary: #d4af37;    /* ทองมาตรฐาน */
    --gold-light: #f9e5af;      /* ทองสว่าง สำหรับไฮไลท์ */
    --gold-dark: #b8860b;       /* ทองเข้ม สำหรับเงา */
    --dark-bg: #000000;         /* ดำสนิท */
    --sidebar-bg: #0a0a0a;      /* ดำเทาเข้ม สำหรับเมนู */
    --card-bg: #111111;         /* ดำเทาอ่อน สำหรับการ์ด */
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --sidebar-width: 260px;
    
    /* ระบบ Gradient ทองหรู */
    --gold-gradient: linear-gradient(45deg, #b8860b, #f9e5af, #b8860b);
    --gold-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
    text-decoration: none;
}

body {
    background-color: var(--dark-bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 5px 0 30px rgba(0,0,0,0.8);
}


.brand {
    padding: 20px;
    display: flex;
    justify-content: center; 
    align-items: center;
    background: transparent; 
}

.logo-link {
    display: block;
    width: 100%;
    text-align: center;
}

.logo-link img {
    max-width: 80%;   
    height: auto;     
    max-height: 70px; 
    object-fit: contain;
    display: inline-block;
}

.text-green { 
    color: var(--gold-primary) !important; 
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6); /* เพิ่มแสงฟุ้ง */
}
.text-gold { color: var(--gold); }

.user-mini-profile {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.avatar { position: relative; width: 40px; height: 40px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--gold-primary); }
.status-dot { width: 10px; height: 10px; background: var(--gold-primary); border-radius: 50%; position: absolute; bottom: 0; right: 0; border: 2px solid var(--sidebar-bg); }
.info .username { display: block; font-size: 14px; font-weight: 500; }
.info .balance { display: block; font-size: 12px; color: var(--gold-primary); font-weight: bold; }

.side-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.side-menu a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-muted);
    font-size: 14px;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

.side-menu a i {
    width: 25px;
    font-size: 16px;
    /* เปลี่ยนจากสีเดิม เป็นสีทองไล่เฉด */
    background: linear-gradient(180deg, #f9e5af, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.3));
}

.side-menu a:hover, .side-menu a.active {
    /* เปลี่ยน rgba(0,255,136,0.1) เป็นสีทองจางๆ */
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    color: #fff;
    border-left-color: var(--gold-primary);
}

.side-menu .badge {
    margin-left: auto;
    background: #ff0040;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.side-menu .separator {
    font-size: 11px;
    text-transform: uppercase;
    color: #4a5e53;
    padding: 15px 25px 5px;
    font-weight: 600;
}

.side-menu .vip-link { color: var(--gold); }
.side-menu .vip-link:hover { text-shadow: 0 0 10px var(--gold); }
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 20px 30px;
    width: calc(100% - var(--sidebar-width));
}
.top-bar {
    display: flex;
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    width: 100%;         /* ให้กว้างเต็มจอ */
    padding: 0 10px;     /* เว้นขอบนิดหน่อย */
    position: relative;  /* เพื่อให้การจัดตำแหน่งอ้างอิงกับกล่องนี้ */
}

.top-actions {
    display: flex;
    gap: 10px;           
    align-items: center;
    margin-left: auto;
}

/* ซ่อน Title ในมือถือเพื่อให้ปุ่มไม่เบียดกัน (ถ้าต้องการ) */
@media (max-width: 768px) {
    .page-title {
        display: none;
    }
}

.page-title { font-size: 20px; font-weight: 600; color: #fff; }

.top-actions button {
    padding: 8px 20px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}
/* --- ปุ่มเข้าสู่ระบบ (Premium Gold Style) --- */
.login-btn {
    position: relative;
    /* ไล่สีทอง 3 เฉด เพื่อมิติที่สวยงาม */
    background: linear-gradient(45deg, #b8860b, #ffd700, #b8860b);
    background-size: 200% auto; /* เตรียมพื้นที่สำหรับอนิเมชั่น */
    color: #000; /* ตัวหนังสือสีดำ ตัดกับสีทอง */
    border: none; /* เอาขอบเดิมออก */
    padding: 8px 25px; /* เพิ่มความกว้างให้ดูเต็มตา */
    border-radius: 50px; /* ทำมุมโค้งมน */
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase; /* ตัวพิมพ์ใหญ่ทั้งหมด */
    letter-spacing: 0.5px; /* ระยะห่างตัวอักษรนิดนึงให้ดูโปร */
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* เงาปกติ */
    transition: all 0.4s ease; /* ความลื่นไหล */
    overflow: hidden;
    z-index: 1;
}

/* เอฟเฟกต์ตอนเอาเมาส์ไปจ่อ (Hover) */
.login-btn:hover {
    background-position: right center; /* เลื่อนสีพื้นหลังให้เหมือนไฟวิ่ง */
    transform: translateY(-3px) scale(1.05); /* ลอยขึ้นนิดนึง + ขยายใหญ่ขึ้น */
    color: #000;
}

/* แถม! เอฟเฟกต์แสงเงาวิ่งผ่าน (Shine Effect) */
.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

.login-btn:hover::after {
    left: 100%; /* แสงวิ่งจากซ้ายไปขวาเมื่อเอาเมาส์แตะ */
}
/* --- ปุ่มติดต่อ LINE (Neon Shake Style) --- */
.line-btn {
    position: relative;
    display: inline-flex; /* จัดไอคอนกับตัวหนังสือให้อยู่กึ่งกลาง */
    align-items: center;
    gap: 8px; /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
    
    /* สีเขียว Line แบบไล่เฉด */
    background: linear-gradient(135deg, #06c755, #00d65b);
    color: #fff;
    border: none;
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    
    /* เงาสีเขียวจางๆ */
    box-shadow: 0 5px 15px rgba(6, 199, 85, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* เด้งดึ๋ง */
    z-index: 1;
    overflow: hidden;
}

/* เอฟเฟกต์ตอนเอาเมาส์ไปจ่อ (Hover) */
.line-btn:hover {
    transform: scale(1.05) translateY(-3px); /* ขยายและลอยขึ้น */
    background: linear-gradient(135deg, #00d65b, #06c755); /* สลับสีให้ดูมีการเคลื่อนไหว */
}

/* สั่งให้ไอคอนข้างใน (ตัว i) ขยับ */
.line-btn i {
    font-size: 18px; /* ขยายไอคอนให้ชัด */
    transition: 0.3s;
}

/* ตอนเอาเมาส์จ่อปุ่ม ให้ไอคอนเขย่า (Shake) */
.line-btn:hover i {
    animation: shake 0.5s ease-in-out both;
}

/* คีย์เฟรมการเขย่า */
@keyframes shake {
    0% { transform: rotate(0); }
    25% { transform: rotate(-20deg) scale(1.2); }
    50% { transform: rotate(20deg) scale(1.2); }
    75% { transform: rotate(-10deg) scale(1.2); }
    100% { transform: rotate(0) scale(1); }
}
.mobile-toggle { display: none; font-size: 24px; cursor: pointer; }

.hero-section {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    background: url('https://via.placeholder.com/1200x400/003300/fff') center/cover;
    height: 300px;
}

.bg-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, #000 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    z-index: 1;
}

.match-info {
    position: relative; z-index: 2;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 500px;
}

.league-tag {
    color: var(--primary);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.teams { display: flex; align-items: center; gap: 20px; margin: 20px 0; }
.team { display: flex; flex-direction: column; align-items: center; color: #fff; }
.team img { width: 60px; margin-bottom: 5px; }
.vs-badge { text-align: center; }
.vs-badge span { font-size: 24px; font-weight: bold; color: #555; }
.live-indicator { background: var(--gold-primary); color: white; padding: 2px 8px; font-size: 10px; border-radius: 4px; animation: pulse 1.5s infinite; }

.watch-now-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: bold;
    width: fit-content;
    cursor: pointer;
}

.quick-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.q-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: 0.3s;
    cursor: pointer;
    height: 85px;
}
.q-card:hover, .q-card.active {
    background: linear-gradient(135deg, #1a1a1a, #000);
    border-color: var(--gold-primary);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.q-card i { font-size: 24px; margin-bottom: 10px; color: var(--gold-primary); }
.q-card.active i { color: #fff; }
.q-card span { display: block; font-size: 14px; color: var(--text-muted); }
.q-card.active span { color: #fff; }


.section-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }
.section-header h3 { font-size: 18px; color: #fff; }
.view-all { font-size: 13px; color: var(--text-muted); transition: 0.3s; }
.view-all:hover { color: var(--gold-primary); }
.video-card.vip {
    border: 1px solid var(--gold-primary);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
}
.video-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

.thumb { position: relative; height: 160px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-tag { position: absolute; top: 10px; left: 10px; background: #ff0040; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.vip-tag { position: absolute; top: 10px; left: 10px; background: var(--gold); color: #000; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.play-overlay, .lock-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: 0.3s;
}
.video-card:hover .play-overlay { opacity: 1; }
.video-card:hover .lock-overlay { opacity: 1; }
.play-overlay i { font-size: 40px; color: #fff; filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); }
.lock-overlay i { font-size: 40px; color: var(--gold); }

.video-card .meta { padding: 15px; }
.video-card h4 { font-size: 15px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-card p { font-size: 12px; color: var(--text-muted); }


.bottom-nav { display: none; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000; /* ดันให้อยู่หน้าสุด */
    transition: all 0.3s ease;
}
@media (max-width: 992px) {
    .main-content { margin-left: 0; width: 100%; padding: 15px; padding-bottom: 80px; }
    .mobile-toggle { display: block; color: var(--text); }
    .page-title { display: none; } 
    .hero-section { height: auto; }
    .match-info { padding: 20px; }
    .quick-menu { grid-template-columns: repeat(2, 1fr); }
    .bottom-nav {
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: #0f1a14;
        border-top: 1px solid rgba(238, 255, 0, 0.2);
        display: flex; justify-content: space-around;
        padding: 10px 0; z-index: 999;
        backdrop-filter: blur(10px);
    }
    
    .b-item {
        display: flex; flex-direction: column; align-items: center;
        color: #666; font-size: 10px; flex: 1;
    }
    .b-item i { font-size: 20px; margin-bottom: 4px; }
    .b-item.active { 
    color: var(--gold-primary); /* เปลี่ยนให้เป็นสีทอง */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}
    
    .b-item.center { position: relative; }
.float-btn {
        width: 60px; /* ขยายขนาดขึ้นเล็กน้อยเพื่อให้ดูเด่น */
        height: 60px;
        /* ไล่เฉดสีทองแบบ Metallic มีมิติ */
        background: linear-gradient(145deg, #f9e5af 0%, #d4af37 45%, #b8860b 100%);
        border-radius: 50%;
        display: flex; 
        justify-content: center; 
        align-items: center;
        position: absolute; 
        top: -35px;
        /* ขอบสีดำตัดกับทองช่วยให้ปุ่มลอยเด่น */
        border: 4px solid var(--dark-bg);
        /* เงาสีทองฟุ้งๆ (Glow) */
        box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 20px rgba(212, 175, 55, 0.4);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .float-btn i { 
        /* ไอคอนสีน้ำตาลเข้มตัดกับพื้นทองช่วยให้ดูแพง */
        color: #5c430d; 
        font-size: 24px; 
        margin: 0;
        text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
    }

    /* เพิ่มเอฟเฟกต์แสงวิ่งผ่าน (Shine Animation) */
    .float-btn::before {
        content: "";
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(45deg);
        transition: 0.5s;
        pointer-events: none;
        opacity: 0;
    }


}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 1);
    margin-bottom: 30px;
    margin-top: 20px;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    align-items: flex-start;
    height: auto;
}

.slide-item {
    min-width: 100%;
    height: auto;
    position: relative;
    display: flex; 
}

.slide-item img {
    width: 100%;
    height: auto;      
    object-fit: unset; 
    display: block;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    display: flex;
    align-items: center;
    padding-left: 50px;
}

.slider-btn {
    padding: 10px 25px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}
.slider-btn:hover { transform: scale(1.05); box-shadow: 0 0 25px rgba(0, 255, 136, 0.6); }



.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}
.nav-btn:hover { 
    background: var(--gold-primary); 
    color: #000; 
}
.prev { left: 15px; }
.next { right: 15px; }

.dots-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}
.dot.active { 
    background: var(--gold-primary); 
    box-shadow: 0 0 10px var(--gold-primary);
}

@media (max-width: 768px) {
    .slider-wrapper { height: auto; } 
    .slider-btn { padding: 8px 16px; font-size: 12px; }
    .nav-btn { width: 30px; height: 30px; font-size: 12px; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out forwards;
}

.modal-content {
    background: #111;
    border: 1px solid var(--primary);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    animation: popupZoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease-in forwards; 
    pointer-events: none; 
}

.modal-overlay.closing .modal-content {
    animation: popupZoomOut 0.3s ease-in forwards; 
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.modal-header h2 {
    color: #fff;
    margin-bottom: 20px;
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

.modal-login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #b8860b, #ffd700);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.modal-login-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.status-text {
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

/* --- Animation Keyframes --- */

/* 1. เฟดพื้นหลัง (จากจางไปเข้ม) */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 2. เด้งกล่องเนื้อหา (จากเล็กไปใหญ่ + ลอยขึ้นมา) */
@keyframes popupZoom {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px); /* เริ่มต้น: เล็กกว่าปกติ และลอยอยู่สูงนิดนึง */
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0); /* จบ: ขนาดปกติ เข้าที่เดิม */
    }
}

/* --- Exit Animations (ขาออก) --- */

/* 1. เฟดพื้นหลังออก (จากเข้มไปจาง) */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 2. หุบกล่องเนื้อหา (จากใหญ่ไปเล็ก + จางหายไป) */
@keyframes popupZoomOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px); 
    }
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    flex: 1; 
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}

.modal-btn.cancel {
    background: #333;
    color: #fff;
    border: 1px solid #555;
}
.modal-btn.cancel:hover {
    background: #444;
}

.modal-btn.confirm {
    background: linear-gradient(45deg, #ff0040, #ff4d4d); 
    color: #fff;
    box-shadow: 0 5px 15px rgba(255, 0, 64, 0.3);
}
.modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 64, 0.5);
}

@media (max-width: 992px) {

.mobile-toggle {
        display: block !important;
        color: var(--text);
        font-size: 28px;
        position: relative; 
        z-index: 1001;
        cursor: pointer;
    }

.sidebar { 
        display: flex !important; 
        position: fixed !important;
        left: -260px; 
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: 10000 !important;
        transition: 0.3s;
    }

.sidebar.active {
        left: 0 !important;
    }

    /* เพิ่มตัวบังพื้นหลังสีดำเวลาเปิดเมนู */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        z-index: 9999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* ใส่ใน style.css หรือ tag <style> ในหน้า pretty.html */
.vip-header {
    background: linear-gradient(90deg, #0b140e, #121f18);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 0 15px rgba(222, 184, 135, 0.3);
}

.pretty-card:hover {
    border-color: var(--gold) !important;
    box-shadow: 0 0 20px rgba(222, 184, 135, 0.4) !important;
}

.text-gold {
    color: var(--gold) !important;
    text-shadow: 0 0 5px rgba(222, 184, 135, 0.5);
}

/* Chat System Styles */
.chat-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
    position: relative;
    transition: 0.3s;
}

.chat-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff0040;
    color: white;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 10px;
    border: 2px solid #000;
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 450px;
    background: #111;
    border: 1px solid #d4af37;
    border-radius: 15px;
    display: none; /* เริ่มต้นซ่อนไว้ */
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: fadeInUp 0.3s ease-out;
}

.chat-header {
    background: #1a1a1a;
    padding: 15px;
    color: #d4af37;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.chat-footer {
    padding: 10px;
    display: flex;
    gap: 10px;
    background: #1a1a1a;
}

.chat-footer input {
    flex: 1;
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
}

/* ปรับระยะขยับหลบ Bottom Nav ในมือถือ */
@media (max-width: 992px) {
    .chat-wrapper {
        bottom: 85px; /* ขยับขึ้นไม่ให้ทับเมนูล่าง */
    }
}

/* --- ปุ่มเปิดแชทลอยตัว (Metallic Gold) --- */
.chat-toggle-btn {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #f9e5af 0%, #d4af37 45%, #b8860b 100%);
    border: 3px solid #000;
    border-radius: 50%;
    color: #000;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.4);
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
}

/* Badge แจ้งเตือนสีแดงตัดทอง */
.chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff0040;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #000;
    font-weight: bold;
}

/* --- หน้าต่างแชท (Luxury Popup) --- */
.chat-container {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 330px;
    height: 480px;
    background: #0a0a0a;
    border: 1px solid var(--gold-primary);
    border-radius: 15px;
    display: none; /* ควบคุมผ่าน JS */
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
    z-index: 10000;
}

/* Animation ขาเข้า (Fade In + Slide Up) */
.chat-container.show {
    display: flex;
    animation: chatFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* Animation ขาออก (Fade Out + Slide Down) */
.chat-container.hide {
    display: flex;
    animation: chatFadeOut 0.3s ease-in forwards;
}

/* Header แชท */
.chat-header {
    background: linear-gradient(90deg, #1a1a1a, #000);
    padding: 15px;
    color: var(--gold-primary);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.chat-header span i {
    margin-right: 8px;
    text-shadow: 0 0 5px var(--gold-primary);
}

.chat-header button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    transition: 0.3s;
}

.chat-header button:hover {
    color: #ff0040;
}

/* ส่วนส่งข้อความ */
.chat-footer {
    padding: 12px;
    background: #111;
    display: flex;
    gap: 10px;
    border-top: 1px solid #222;
}

.chat-footer input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    outline: none;
    font-size: 13px;
}

.chat-footer input:focus {
    border-color: var(--gold-primary);
}

.chat-send-btn {
    background: var(--gold-gradient);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Keyframes Animations --- */
@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes chatFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* --- ปุ่มส่งข้อความ (Metallic Gold Send Button) --- */
.chat-send-btn {
    background: linear-gradient(145deg, #f9e5af 0%, #d4af37 45%, #b8860b 100%);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px; /* ปรับให้เป็นทรงสี่เหลี่ยมมุมมนตามรูป */
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.chat-send-btn i {
    transform: rotate(-15deg); /* เอียงไอคอนจรวดเล็กน้อยให้ดูมีพลัง */
}

/* --- เอฟเฟกต์การปิด Popup (Fade Out) --- */

/* สถานะเริ่มต้นเมื่อเปิด */
.chat-container.show {
    display: flex;
    animation: fadeInSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* สถานะเมื่อกำลังปิด */
.chat-container.hide {
    display: flex; /* ยังต้องให้แสดงอยู่ระหว่างเล่น Animation */
    animation: fadeOutSlideDown 0.3s ease-in forwards;
}

/* Keyframes สำหรับ Fade In */
@keyframes fadeInSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Keyframes สำหรับ Fade Out (ค่อยๆ หายไป) */
@keyframes fadeOutSlideDown {
    from { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
    to { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
}

/* ตกแต่งกล่อง Input ให้เข้าคู่กัน */
.chat-footer {
    background: #111;
    padding: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    gap: 10px;
}

.chat-footer input {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 20px;
    color: #fff;
    padding: 8px 15px;
    flex: 1;
    outline: none;
}

.chat-footer input:focus {
    border-color: #d4af37;
}

/* --- 1. แต่ง Scrollbar ให้สวยหรู (สีทอง-ดำ) --- */
/* แกนหลัก */
::-webkit-scrollbar {
    width: 8px;  /* ความกว้าง */
    height: 8px; /* ความสูง (แนวนอน) */
}

/* รางเลื่อน (พื้นหลัง) */
::-webkit-scrollbar-track {
    background: #000; 
    border-left: 1px solid #222;
}

/* ตัวเลื่อน (สีทอง) */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b8860b, #d4af37, #b8860b);
    border-radius: 10px;
    border: 1px solid #000;
}

/* ตอนเอาเมาส์ชี้ */
::-webkit-scrollbar-thumb:hover {
    background: #ffd700; 
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}



/* --- ปุ่มออกจากระบบ (Premium Red Style) --- */
.logout-btn {
    position: relative;
    /* ไล่สีแดงเข้ม มีมิติ */
    background: linear-gradient(45deg, #8b0000, #dc143c, #8b0000);
    background-size: 200% auto;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4); /* เงาสีแดง */
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px; /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.6);
}

.logout-btn i {
    font-size: 14px;
}

/* --- Background Overlay (ฉากหลังเบลอ) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* ดำโปร่งแสง */
    backdrop-filter: blur(8px); /* เบลอฉากหลัง */
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

/* --- กล่อง Modal (ดีไซน์หรู) --- */
.luxury-modal {
    background: linear-gradient(145deg, #1a1a1a 0%, #000000 100%);
    border: 1px solid rgba(212, 175, 55, 0.3); /* ขอบทองจางๆ */
    border-radius: 20px;
    padding: 40px 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.8), /* เงาหลัก */
        0 0 30px rgba(212, 175, 55, 0.1); /* แสงทองฟุ้งๆ */
    text-align: center;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- ปุ่มปิด (กากบาท) --- */
.close-modal {
    position: absolute;
    top: 15px; right: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
    width: 35px; height: 35px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.close-modal:hover {
    background: rgba(255, 0, 64, 0.2);
    color: #ff0040;
}

/* --- Header ส่วนหัว --- */
.modal-icon-wrapper {
    font-size: 50px;
    margin-bottom: 15px;
    background: linear-gradient(180deg, #f9e5af, #d4af37, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
}

.modal-header h2 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    color: #888;
    font-size: 13px;
    margin-bottom: 30px;
}

/* --- ช่องกรอกข้อมูล (Input) --- */
.luxury-input {
    position: relative;
    margin-bottom: 20px;
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 5px;
    transition: 0.3s;
}

.luxury-input:focus-within {
    border-color: #d4af37; /* เปลี่ยนเป็นขอบทองเมื่อกดพิมพ์ */
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.icon-box {
    width: 40px;
    height: 40px;
    display: flex; justify-content: center; align-items: center;
    color: #666;
    font-size: 16px;
    transition: 0.3s;
}

.luxury-input:focus-within .icon-box {
    color: #d4af37; /* ไอคอนเปลี่ยนเป็นสีทอง */
}

.luxury-input input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    padding: 10px;
    outline: none;
    font-size: 14px;
}
.luxury-input input::placeholder { color: #555; }

/* --- ปุ่ม Login (ทอง Metallic) --- */
.luxury-btn {
    width: 100%;
    padding: 14px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(to bottom, #f9e5af 0%, #d4af37 50%, #b8860b 100%);
    color: #000;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.luxury-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    filter: brightness(1.1);
}

/* --- ข้อความสถานะและ Footer --- */
.status-text {
    margin-top: 15px;
    height: 20px;
    font-size: 13px;
}

.modal-footer-text {
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.modal-footer-text a {
    color: #d4af37;
    text-decoration: none;
    font-weight: bold;
}
.modal-footer-text a:hover { text-decoration: underline; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- Success Modal Styles --- */
.success-icon-box {
    font-size: 60px;
    background: linear-gradient(135deg, #00ff88, #00b359); /* สีเขียวมรกตดูรวย */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    
    /* Animation เด้งดึ๋ง */
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* --- Warning Modal Styles --- */
.warning-icon-box {
    font-size: 50px;
    color: #d4af37; /* สีทอง */
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
    
    /* ให้ไอคอนสั่นเตือนดุ๊กดิ๊ก */
    animation: shake 0.5s ease-in-out;
}

/* (ถ้ายังไม่มี Keyframes shake ให้เติมอันนี้ลงไปครับ) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* =========================================
   ส่วนเสริม: Loading Animation แบบมือโปร
   ========================================= */

/* 1. สร้าง Keyframes ให้มันหมุน */
@keyframes spin-pro {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. ตั้งค่าปุ่มตอนกำลังโหลด (ใส่ class นี้ด้วย JS) */
.luxury-btn.loading {
    color: transparent !important; /* ซ่อนตัวหนังสือและไอคอนเดิม */
    pointer-events: none;          /* ห้ามกดซ้ำรัวๆ */
    position: relative;            /* เพื่อให้วางตัวหมุนได้ */
    opacity: 0.8;
}

/* 3. สร้างวงกลมหมุนๆ ตรงกลางปุ่ม */
.luxury-btn.loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;       /* ขนาดวงกลม */
    height: 24px;
    margin-left: -12px; /* จัดกึ่งกลาง (ครึ่งของ width) */
    margin-top: -12px;  /* จัดกึ่งกลาง (ครึ่งของ height) */
    
    /* สร้างเส้นวงกลม */
    border: 3px solid rgba(0, 0, 0, 0.2); /* สีจางๆ รองพื้น */
    border-top-color: #000;               /* สีเส้นหมุน (ดำ ตัดกับปุ่มทอง) */
    border-radius: 50%;                   /* ทำให้กลม */
    
    /* สั่งให้หมุน */
    animation: spin-pro 0.8s linear infinite;
}

/* ปรับ Status Text ให้ดูดีขึ้นด้วย */
.status-text i {
    margin-right: 5px;
}

