/* =========================================
   1. MAIN LAYOUT & GLOBAL VARIABLES
   ========================================= */
:root {
    /* โทนสีทอง-ดำ Metallic */
    --gold-primary: #d4af37;
    --gold-light: #f9e5af;
    --gold-dark: #b8860b;
    --dark-bg: #000000;
    --sidebar-bg: #0a0a0a;
    --card-bg: #111111;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --sidebar-width: 260px;
    
    /* ระบบ Gradient และ Shadow */
    --gold-gradient: linear-gradient(45deg, #b8860b, #f9e5af, #b8860b);
    --gold-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    --border-color: rgba(212, 175, 55, 0.2);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    font-family: 'Prompt', sans-serif;
    margin: 0;
    padding-left: var(--sidebar-width);
    transition: 0.3s;
}

@media (max-width: 991px) {
    body { padding-left: 0; }
}

.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);
}

.sidebar .brand {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar .brand img {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}

/* User Profile Mini */
.user-mini-profile {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.user-mini-profile .avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--gold-primary);
    box-shadow: var(--gold-shadow);
}

.user-mini-profile .status-dot {
    background: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-primary);
}

.user-mini-profile .info .username {
    color: var(--gold-light);
    font-weight: 600;
}
.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;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
}

.side-menu a i {
    width: 30px;
    font-size: 18px;
    background: linear-gradient(180deg, #f9e5af, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.side-menu a:hover, .side-menu a.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    color: #fff;
    border-left-color: var(--gold-primary);
}



.line-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #06c755, #00d65b);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(6, 199, 85, 0.3);
}

.line-btn:hover {
    transform: scale(1.05) translateY(-3px);
}

.line-btn:hover i {
    animation: shake 0.5s ease-in-out infinite;
}



/* =========================================
   4. BOTTOM NAV (เมนูล่างมือถือดีไซน์ทอง)
   ========================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    z-index: 999;
    backdrop-filter: blur(15px);
}

.b-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 11px;
}

.b-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.b-item.active {
    color: var(--gold-primary);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ปุ่มกลาง (Float Gold Button) */
.float-btn {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #f9e5af 0%, #d4af37 45%, #b8860b 100%);
    border-radius: 50%;
    position: absolute;
    top: -35px;
    border: 4px solid var(--dark-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 20px rgba(212, 175, 55, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.float-btn i {
    color: #5c430d;
    font-size: 26px;
    margin: 0;
}

.float-btn:hover {
    transform: scale(1.1) translateY(-5px);
}

@media (max-width: 991px) {
    .bottom-nav { display: flex; }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes shake {
    0% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0); }
}

/* =========================================
   1. MAIN LAYOUT & GLOBAL VARIABLES
   ========================================= */
:root {
    --gold-primary: #d4af37;
    --gold-light: #f9e5af;
    --gold-dark: #b8860b;
    --dark-bg: #000000;
    --sidebar-bg: #0a0a0a;
    --card-bg: #111111;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --sidebar-width: 260px;
    
    --gold-gradient: linear-gradient(45deg, #b8860b, #f9e5af, #b8860b);
    --gold-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    --border-color: rgba(212, 175, 55, 0.2);
}

* {
    text-decoration: none !important; /* [โจทย์] ไม่เอาขีดเส้นใต้ลิงก์ทุกลิงก์ */
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    font-family: 'Prompt', sans-serif;
    margin: 0;
    padding-left: var(--sidebar-width);
    transition: 0.3s;
}

@media (max-width: 991px) {
    body { padding-left: 0; }
}

/* =========================================
   2. TOP BAR & ACTION BUTTONS (ขวาสุด)
   ========================================= */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* แยกปุ่ม 3 ขีด กับ กลุ่มปุ่มขวาออกจากกัน */
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-actions {
    display: flex;
    gap: 12px;
    margin-left: auto; /* [โจทย์] ดันปุ่มออกจากระบบและไลน์ไปขวาสุด */
    align-items: center;
}

/* [โจทย์] ปุ่ม 3 ขีดดีไซน์พรีเมียม */
.mobile-toggle { display: none; font-size: 24px; cursor: pointer; }

.mobile-toggle:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8));
}



/* =========================================
   3. SIDEBAR (เมนูด้านข้าง)
   ========================================= */
.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;
}

/* สำหรับ Chrome, Safari และ Edge (เวอร์ชันใหม่) */
.sidebar::-webkit-scrollbar {
    display: none;             /* ซ่อนตัวแถบเลื่อนทั้งหมด */
}

.side-menu a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: var(--text-muted);
    font-size: 14px;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.side-menu a i {
    width: 30px;
    font-size: 18px;
    background: linear-gradient(180deg, #f9e5af, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.side-menu a:hover, .side-menu a.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    color: #fff;
    border-left-color: var(--gold-primary);
}

@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;
    }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
}


.line-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #06c755, #00d65b);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 13px;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}

.line-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(6, 199, 85, 0.5);
}



/* =========================================
   5. BOTTOM NAV (เมนูล่างมือถือ)
   ========================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    z-index: 999;
}

@media (max-width: 991px) {
    .bottom-nav { display: flex; }
}

.b-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 11px;
}

.b-item.active {
    color: var(--gold-primary);
}

.float-btn {
    width: 65px;
    height: 65px;
    background: var(--gold-gradient);
    border-radius: 50%;
    position: absolute;
    top: -32px;
    border: 4px solid var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.float-btn i {
    color: #5c430d;
    font-size: 26px;
}

.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%; /* แสงวิ่งจากซ้ายไปขวาเมื่อเอาเมาส์แตะ */
}

.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);
}

.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;
}

.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);
}

.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);
}

.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; }

.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);
}

.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;
}

/* --- ปุ่มปิด (กากบาท) --- */
.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;
}



.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: 768px) {
    .page-title {
        display: none;
    }
}

.page-title { font-size: 20px; font-weight: 600; color: #fff; }

::-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);
}

.side-menu a {
    position: relative;
    margin: 8px 15px;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 162, 255, 0.1);
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: 0.4s;
    color: #888;
}

.side-menu a::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.8) 0%, transparent 70%);
    animation: move-orb 3s linear infinite;
    top: -20px;
    left: -20px;
    opacity: 0;
    filter: blur(5px);
}

@keyframes move-orb {
    0% { left: -10%; top: -50%; }
    25% { left: 100%; top: -50%; }
    50% { left: 100%; top: 50%; }
    75% { left: -10%; top: 50%; }
    100% { left: -10%; top: -50%; }
}

.side-menu a::after {
    content: '';
    position: absolute;
    inset: 1px; 
    background: rgba(15, 15, 20, 0.9);
    border-radius: 11px;
    z-index: -1;
}

.side-menu a:hover, .side-menu a.active {
    color: #00f2ff !important;
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
    transform: scale(1.05);
}

.side-menu a:hover::before, .side-menu a.active::before {
    opacity: 1; 
}

@keyframes rotate-border {
    100% { transform: rotate(360deg); }
}

/* สไตล์พื้นฐานของ Badge ยศ */
.rank-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    margin-right: 6px;
    text-transform: uppercase;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

/* สีตามระดับยศ */
.rank-member { background: #666; color: #fff; }
.rank-bronze { background: linear-gradient(45deg, #a0522d, #cd7f32); color: #fff; }
.rank-silver { background: linear-gradient(45deg, #757575, #e0e0e0); color: #000; }
.rank-gold   { background: linear-gradient(45deg, #b8860b, #ffd700); color: #000; box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.rank-platinum { background: linear-gradient(45deg, #546e7a, #b0bec5); color: #000; }
.rank-diamond  { background: linear-gradient(45deg, #00acc1, #e0f7fa); color: #000; box-shadow: 0 0 10px rgba(0, 172, 193, 0.5); }

/* ยศสูงสุดมีเอฟเฟกต์แวววาว */
.rank-legendary {
    background: linear-gradient(45deg, #ff0000, #ffd700, #ff0000);
    background-size: 200% auto;
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
    animation: shine-vip 2s linear infinite;
}

@keyframes shine-vip {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}