@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #07050f;
    --bg-card: #130d26;
    --primary: #9d4edd;
    --secondary: #6c5ce7;
    --text-light: #f8f8f2;
    --text-muted: #a395b8;
    --glow-primary: 0 0 15px rgba(157, 78, 221, 0.4);
    --glow-secondary: 0 0 15px rgba(255, 121, 198, 0.4);
}

/* ===================================================
   🚀 [FEATURE #72] Custom Scrollbar - Wiz Theme
   =================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: var(--glow-primary);
}

/* บังคับใช้กับทุกเบราว์เซอร์ (Firefox) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-main);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Kanit', sans-serif; }
body {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 15% 50%, rgba(157, 78, 221, 0.15) 0%, transparent 40%), radial-gradient(circle at 85% 30%, rgba(255, 121, 198, 0.12) 0%, transparent 40%);
    color: var(--text-light); min-height: 100vh; overflow-x: hidden;
}

header {
    display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%;
    background: rgba(19, 13, 38, 0.8); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(157, 78, 221, 0.3);
    position: sticky; top: 0; z-index: 100;
}

.logo {
    font-size: 1.5rem; font-weight: 700; background: linear-gradient(45deg, var(--secondary), var(--primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-transform: uppercase; letter-spacing: 1px;
	display: flex;
    align-items: center;
}

.logo img {
    height: 60px; 
    width: auto;  
    display: block;
}

.nav-controls { display: flex; gap: 1rem; align-items: center; }
.nav-menu {
    display: flex;
    gap: 30px;
    margin-left: 40px;
    flex: 1; 
}

.nav-item {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    opacity: 1;
    color: var(--primary); 
    text-shadow: var(--glow-primary);
    transform: translateY(-2px);
}
.server-select { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--primary); color: var(--text-light); padding: 0.6rem 1rem; border-radius: 8px; outline: none; cursor: pointer; font-weight: 500; transition: box-shadow 0.3s; }
.server-select:focus { box-shadow: var(--glow-primary); }
.server-select option { background: var(--bg-card); color: var(--text-light); }

.btn-discord {
    background: #5865F2; color: white; border: none; padding: 0.6rem 1.5rem; border-radius: 8px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 0.6rem; transition: all 0.3s;
}
.btn-discord:hover { background: #4752c4; box-shadow: 0 0 12px rgba(88, 101, 242, 0.6); transform: translateY(-2px); }

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 5%; }
.profile-section {
    display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); padding: 1.8rem 2.5rem; border-radius: 16px; border: 1px solid rgba(157, 78, 221, 0.2); margin-bottom: 2.5rem; box-shadow: var(--glow-primary); position: relative; overflow: hidden;
}
.profile-section::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, var(--primary), var(--secondary)); }

.user-info { display: flex; align-items: center; gap: 1.2rem; }
.avatar { width: 65px; height: 65px; border-radius: 50%; background: linear-gradient(45deg, var(--primary), var(--secondary)); padding: 2px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #000; }

.balances { display: flex; gap: 2.5rem; align-items: center; }
.balance-item { text-align: right; }
.balance-val { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.gc-val { color: var(--secondary); }
.pt-val { color: var(--primary); }
.balance-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.btn-topup {
    background: transparent; border: 2px solid var(--secondary); color: var(--secondary); padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none;
}
.btn-topup:hover { background: var(--secondary); color: #fff; box-shadow: var(--glow-secondary); transform: translateY(-2px); }

.tabs { display: flex; gap: 1rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.5rem; }
.tab { padding: 0.8rem 2rem; border-radius: 8px 8px 0 0; cursor: pointer; font-weight: 500; font-size: 1.1rem; transition: all 0.3s; color: var(--text-muted); border: none; background: transparent; position: relative; }
.tab::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: transparent; transition: all 0.3s; }
.tab.active { color: var(--text-light); }
.tab.active::after { background: linear-gradient(90deg, var(--primary), var(--secondary)); box-shadow: var(--glow-primary); }
.tab:hover:not(.active) { color: #fff; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.item-card { background: rgba(19, 13, 38, 0.6); border-radius: 12px; padding: 1.5rem; text-align: center; border: 1px solid rgba(255, 255, 255, 0.05); transition: all 0.3s ease; position: relative; }
.item-card:hover { transform: translateY(-5px); border-color: rgba(157, 78, 221, 0.4); box-shadow: 0 10px 20px rgba(0,0,0,0.4), var(--glow-primary); background: rgba(19, 13, 38, 0.9); }

.item-img { width: 100%; height: 140px; margin: 0 auto 1.2rem; background: rgba(0,0,0,0.3); border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.02); }
.item-img img { max-width: 65%; max-height: 65%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,255,255,0.1)); transition: transform 0.3s; }
.item-card:hover .item-img img { transform: scale(1.1); }
.item-name { font-size: 1.1rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--text-light); }
.item-price { font-weight: 600; font-size: 1.3rem; margin-bottom: 1.2rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.price-gc { color: var(--secondary); }
.price-pt { color: var(--primary); }
.price-label { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }

.btn-buy { width: 100%; color: white; border: none; padding: 0.75rem; border-radius: 8px; font-weight: 500; font-size: 1rem; cursor: pointer; transition: all 0.3s; }
.btn-buy-gc { 
    background: linear-gradient(45deg, #4b1b85, #8a2be2);
}
.btn-buy-gc:hover { 
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6); 
}

.btn-buy-pt { 
    background: linear-gradient(45deg, #2b1055, #6c5ce7); 
}
.btn-buy-pt:hover { 
    box-shadow: var(--glow-secondary); 
}

@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; }
    .nav-menu { margin-left: 0; justify-content: center; width: 100%; flex-wrap: wrap; gap: 15px; }
    .profile-section { flex-direction: column; text-align: center; gap: 1.5rem; padding: 1.5rem; }
    .user-info { flex-direction: column; }
    .balances { flex-wrap: wrap; justify-content: center; gap: 1.5rem; width: 100%; }
    .balance-item { text-align: center; }
    .tabs { justify-content: center; }
}

.btn-swal-confirm:hover {
    background-color: #2ecc71 !important; 
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6) !important;
    transform: translateY(-2px);
}

.btn-swal-cancel:hover {
    background-color: #e74c3c !important; 
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6) !important;
    transform: translateY(-2px);
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start; 
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    margin-right: -50px; 
}

.content-area {
    flex-grow: 1; 
}

.user-info.vertical div {
    width: 100%;
    text-align: right;
}
.user-info.vertical h3, .user-info.vertical h3 span {
    text-align: right;
}
.user-info.vertical p {
    text-align: right;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center;
}

.container-wide {
    min-width: 1100px !important; 
}

.sidebar {
    min-width: 320px;
}

.container-wide {
    max-width: 1800px !important; 
    width: 98% !important;        
    margin: 0 auto;               
}

.main-layout {
    display: flex;
    flex-direction: row-reverse; 
    justify-content: space-between; 
    gap: 2rem; 
    align-items: flex-start;
}

.slideshow-container {
    width: 100%;
    position: relative;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.slide {
    display: none;
}

.slide img {
    width: 100%;
    height: 300px; 
    object-fit: cover;
    display: block;
}

.prev-slide, .next-slide {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s ease;
    border-radius: 0 8px 8px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    text-decoration: none;
}

.next-slide {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.prev-slide:hover, .next-slide:hover {
    background-color: var(--primary);
    box-shadow: 0 0 15px var(--glow-primary);
}

.dot-container {
    text-align: center;
    position: absolute;
    bottom: 15px;
    width: 100%;
}

.slide-dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.active-dot, .slide-dot:hover {
    background-color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    transform: scale(1.3);
}

.fade {
    animation-name: fadeAnim;
    animation-duration: 1s;
}

@keyframes fadeAnim {
    from {opacity: 0.4} 
    to {opacity: 1}
}

.balances.vertical > div[style="margin-top: 2rem;"] {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important; 
    margin-top: 2.5rem !important; 
}

.btn-topup {
    width: 80% !important; 
    max-width: 250px; 
    justify-content: center;
    padding: 12px !important;
    font-size: 1.1rem;
    box-sizing: border-box; 
}

.profile-card {
    background: rgba(19, 13, 38, 0.8);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center; 
    box-shadow: var(--glow-primary);
}

.avatar-box {
    width: 100px; 
    height: 100px; 
    margin: 0 auto 15px auto;
}
.avatar-box img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 50%; 
    border: 3px solid var(--primary);
}

.profile-head {
    text-align: center;
    width: 100%;
}
.welcome-txt { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 5px; }
.name-txt { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.id-badge { font-size: 0.8rem; color: var(--text-muted); background: rgba(0,0,0,0.3); padding: 5px 12px; border-radius: 20px; display: inline-block; }

.card-divider {
    border: 0; 
    border-top: 1px dashed rgba(255,255,255,0.1); 
    width: 100%; 
    margin: 1.5rem 0;
}

.balance-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
}
.bal-box {
    text-align: center;
}
.bal-title {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.bal-amount {
    font-size: 1.8rem;
    font-weight: 700;
}
.unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.btn-sidebar {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    width: 85%;
    max-width: 250px;
    margin: 2rem auto 0 auto;
    padding: 12px;
    font-size: 1.1rem;
    box-sizing: border-box;
}

@media (max-width: 950px) {
    .container-wide {
        min-width: 100% !important;
        width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box;
    }

    .main-layout {
        flex-direction: column !important; 
        gap: 2rem;
    }

    .sidebar {
        width: 100% !important;
        min-width: 100% !important;
        position: relative !important;
        top: 0 !important;
        margin-top: 0 !important;
    }

    .bal-amount {
        font-size: 1.5rem !important;
    }

    .btn-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
	
    h1, h2, h3 {
        font-size: 1.2rem !important; 
        line-height: 1.5 !important;  
        padding: 0 13px; 
        word-break: break-word; 
    }

}

.btn-history {
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    color: var(--text-muted); 
    text-decoration: none !important; 
    border-radius: 8px; 
    margin-top: 12px !important; 
    transition: all 0.3s ease;
}

.btn-history:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.floating-cart {
    position: fixed; bottom: 30px; right: 30px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    width: 65px; height: 65px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 10px 25px rgba(0,0,0,0.5), var(--glow-primary);
    z-index: 999; transition: transform 0.3s ease;
}
.floating-cart:hover { transform: scale(1.1); }
.cart-badge {
    position: absolute; top: -5px; right: -5px;
    background: #e74c3c; color: white; font-size: 0.85rem; font-weight: bold;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; border: 2px solid #130d26;
}

.cart-sidebar {
    position: fixed; top: 0; right: -400px; 
    width: 350px; height: 100vh; background: rgba(15, 10, 28, 0.95);
    backdrop-filter: blur(15px); border-left: 1px solid rgba(157, 78, 221, 0.3);
    box-shadow: -10px 0 30px rgba(0,0,0,0.6); z-index: 1000;
    display: flex; flex-direction: column; transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-sidebar.open { right: 0; }

.cart-header {
    padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
}
.btn-close-cart {
    background: transparent; border: none; color: #fff; font-size: 1.2rem;
    cursor: pointer; transition: color 0.3s;
}
.btn-close-cart:hover { color: #e74c3c; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.cart-item {
    display: flex; gap: 15px; background: rgba(0,0,0,0.3); padding: 10px;
    border-radius: 10px; border: 1px solid rgba(255,255,255,0.05); align-items: center;
}
.cart-item img { width: 50px; height: 50px; object-fit: contain; background: rgba(255,255,255,0.05); border-radius: 6px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.95rem; color: #fff; margin-bottom: 3px; }
.cart-item-price { font-size: 0.9rem; font-weight: bold; }
.btn-remove-item { background: #e74c3c; color: white; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; }

.cart-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.5); }
.cart-total { display: flex; flex-direction: column; gap: 5px; font-size: 1.1rem; margin-bottom: 15px; }
.btn-checkout-all {
    width: 100%; padding: 15px; border-radius: 10px; border: none;
    background: linear-gradient(45deg, #2ecc71, #27ae60); color: white;
    font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: all 0.3s;
}
.btn-checkout-all:hover { box-shadow: 0 0 15px rgba(46, 204, 113, 0.5); transform: translateY(-2px); }

@media (max-width: 400px) { .cart-sidebar { width: 100%; right: -100%; } }

.cart-qty-controls {
    display: flex; align-items: center; gap: 8px; margin-top: 5px;
}
.btn-qty {
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; 
    width: 24px; height: 24px; 
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: all 0.2s; font-weight: bold;
}
.btn-qty:hover { 
    background: var(--primary); 
    border-color: var(--primary); 
}
.qty-display { 
    font-size: 0.95rem; 
    min-width: 20px; 
    text-align: center; 
    font-weight: 500;
}

.server-icon {
    height: 140px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.img-icon-server {
    max-width: 150%;
    max-height: 150%; 
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.server-card:hover .img-icon-server {
    transform: scale(1.15) translateY(-5px);
}

.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 15px; margin-bottom: 40px; }
.coupon-card { background: rgba(19, 13, 38, 0.8); border: 1px solid rgba(157, 78, 221, 0.3); border-radius: 15px; padding: 20px; position: relative; overflow: hidden; }
.coupon-card::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background: var(--bg-dark); border-radius: 50%; border-right: 1px solid rgba(157, 78, 221, 0.3); }
.coupon-card::after { content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background: var(--bg-dark); border-radius: 50%; border-left: 1px solid rgba(157, 78, 221, 0.3); }
.coupon-code { background: rgba(0,0,0,0.5); padding: 10px; text-align: center; font-size: 1.2rem; font-weight: bold; letter-spacing: 2px; border: 1px dashed var(--primary); margin: 15px 0; border-radius: 8px; cursor: pointer; color: #fff; transition: 0.3s; }
.coupon-code:hover { background: rgba(157, 78, 221, 0.2); }
.status-used { opacity: 0.5; filter: grayscale(100%); }
.btn-redeem { width: 100%; padding: 10px; background: linear-gradient(45deg, #00d2ff, #3a7bd5); color: #fff; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-redeem:hover { box-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }