/* ===== GAMING THEME OPTIMIZED - Fixed Layout ===== */

/* ===== VARIABLES ===== */
:root {
    --gaming-dark: #1a1f3a;
    --gaming-darker: #0f1420;
    --gaming-blue: #3b5998;
    --gaming-cyan: #00d9ff;
    --gaming-pink: #ff69b4;
    --gaming-purple: #6b5b95;
    --gaming-gold: #ffd700;
    --gaming-border: rgba(59, 130, 246, 0.3);
    --discord-width: 280px;
    --sidebar-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--gaming-darker) !important;
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: #ffffff !important;
    overflow-x: hidden;
}

/* Background với particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1), transparent 50%);
    z-index: 0;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 1;
}

/* ===== IMPROVED DISCORD SIDEBAR ===== */
#left-sidebar {
    position: fixed;
    left: 0;
    top: 80px; /* Dưới header */
    bottom: 0;
    width: var(--discord-width);
    z-index: 900;
    transition: transform var(--sidebar-transition);
    background: linear-gradient(135deg, 
        rgba(26, 31, 58, 0.98),
        rgba(26, 31, 58, 0.95));
    backdrop-filter: blur(20px);
    border-right: 2px solid var(--gaming-border);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Hidden state - chỉ để lại toggle button */
#left-sidebar.hidden {
    transform: translateX(calc(-1 * var(--discord-width) + 50px));
}

#left-sidebar.hidden #toggle-widget {
    transform: translateX(calc(var(--discord-width) - 50px)) !important;
    right: auto !important;
    left: 0 !important;
}



.discord-widget {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-left: 10px; /* Để chỗ cho toggle button */
}

.discord-widget iframe {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.discord-widget a {
    display: block;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.discord-widget a:hover {
    background: linear-gradient(135deg, #6875ff, #5865F2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.5);
}

/* Toggle button - luôn visible */



/* ===== MAIN CONTENT ADJUSTMENT ===== */
.tight-space {
    margin-left: calc(var(--discord-width) + 20px);
    transition: margin-left var(--sidebar-transition);
}

/* When Discord is hidden */
.sidebar-hidden .tight-space {
    margin-left: 70px !important;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(180deg, 
        rgba(26, 31, 58, 0.98) 0%,
        rgba(26, 31, 58, 0.90) 100%) !important;
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--gaming-border) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6) !important;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrap {
    background: transparent !important;
    max-width: none !important;
    padding: 12px 20px;
}

/* Logo gaming effect */
.brand img {
    filter: drop-shadow(0 0 15px rgba(0, 217, 255, 0.6));
    transition: all 0.3s ease;
}

.brand:hover img {
    filter: drop-shadow(0 0 25px rgba(0, 217, 255, 0.9));
    transform: scale(1.05);
}

/* Search bar gaming */
.search-bar {
    background: rgba(26, 31, 58, 0.6) !important;
    border: 2px solid var(--gaming-border) !important;
    border-radius: 25px !important;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.search-bar input {
    background: transparent !important;
    border: none !important;
    color: white !important;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.search-btn {
    background: linear-gradient(135deg, #00d9ff, #0099cc) !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #00eeff, #00b8e6) !important;
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.6);
    transform: scale(1.1);
}

/* ===== LOGIN BUTTON WITH POPUP ===== */
.btn-primary {
    background: linear-gradient(135deg, #00d9ff, #0099cc) !important;
    border: 2px solid #00d9ff !important;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
    cursor: pointer;
    position: relative;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00eeff, #00b8e6) !important;
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.6);
    transform: translateY(-2px);
}

/* Login Popup */
.login-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.login-popup.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-container {
    background: linear-gradient(135deg, 
        rgba(26, 31, 58, 0.98),
        rgba(26, 31, 58, 0.95));
    backdrop-filter: blur(30px);
    border: 2px solid var(--gaming-border);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 217, 255, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.6);
}

.login-logo i {
    font-size: 40px;
    color: white;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #00d9ff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.6);
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
}

.form-group input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    background: rgba(26, 31, 58, 0.6);
    border: 2px solid var(--gaming-border);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00d9ff;
    background: rgba(26, 31, 58, 0.8);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #00d9ff;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00d9ff;
}

.remember-me label {
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-weight: normal !important;
}

.forgot-password {
    color: #00d9ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #00eeff;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.5);
    margin-top: 10px;
}

.login-button:hover {
    background: linear-gradient(135deg, #00eeff, #00b8e6);
    box-shadow: 0 6px 30px rgba(0, 217, 255, 0.7);
    transform: translateY(-2px);
}

.login-button:active {
    transform: translateY(0);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gaming-border);
}

.login-divider span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.social-btn {
    padding: 12px;
    border: 2px solid var(--gaming-border);
    border-radius: 10px;
    background: rgba(26, 31, 58, 0.6);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #00d9ff;
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.login-footer a {
    color: #00d9ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-footer a:hover {
    color: #00eeff;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

.close-login {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 59, 48, 0.2);
    border: 2px solid rgba(255, 59, 48, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.close-login:hover {
    background: rgba(255, 59, 48, 0.9);
    border-color: #ff3b30;
    transform: rotate(90deg);
}

/* ===== HEADER BUTTONS ===== */
.header-right a {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid var(--gaming-border);
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.header-right a:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: #00d9ff;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.3) !important;
    border: 2px solid rgba(139, 92, 246, 0.5) !important;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.5) !important;
    border-color: #8b5cf6 !important;
}

.btn-contact {
    background: linear-gradient(135deg, #ff69b4, #ff1493) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.btn-contact:hover {
    background: linear-gradient(135deg, #ff85c1, #ff1493) !important;
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
}

/* Language selector gaming */
#language-btn {
    background: rgba(59, 130, 246, 0.2) !important;
    border: 2px solid var(--gaming-border) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#language-btn:hover {
    background: rgba(59, 130, 246, 0.4) !important;
    border-color: #00d9ff !important;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4);
}

.language-menu {
    background: rgba(26, 31, 58, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 2px solid var(--gaming-border) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.language-menu a:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    border-left: 3px solid #00d9ff;
}

/* ===== BANNER GAMING ===== */
.banner-container {
    border: 3px solid var(--gaming-border) !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(59, 130, 246, 0.3);
}

/* ===== GAME CARDS ===== */
.game {
    background: linear-gradient(135deg, 
        rgba(26, 31, 58, 0.8),
        rgba(26, 31, 58, 0.6)) !important;
    backdrop-filter: blur(10px);
    border: 2px solid var(--gaming-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game:hover {
    transform: translateY(-15px) scale(1.03) !important;
    border-color: #00d9ff !important;
    box-shadow: 0 15px 50px rgba(0, 217, 255, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    #left-sidebar {
        transform: translateX(calc(-1 * var(--discord-width)));
    }
    
    #left-sidebar.show-mobile {
        transform: translateX(0);
    }
    
    .tight-space {
        margin-left: 0 !important;
    }
    
    /* Mobile toggle button */
    .mobile-discord-toggle {
        position: fixed;
        left: 10px;
        top: 90px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #5865F2, #4752C4);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 950;
        box-shadow: 0 4px 20px rgba(88, 101, 242, 0.5);
    }
    
    .mobile-discord-toggle:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    border: 2px solid #00d9ff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.5);
    transition: all 0.3s ease;
}

.scroll-to-top.visible {
    display: flex;
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #00eeff, #00b8e6);
    box-shadow: 0 6px 30px rgba(0, 217, 255, 0.7);
    transform: translateY(-5px);
}

.scroll-to-top i {
    color: white;
    font-size: 20px;
}

/* ===== LOADING STATE ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 32, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 217, 255, 0.2);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ACCESSIBILITY ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus styles */
*:focus-visible {
    outline: 3px solid #00d9ff;
    outline-offset: 3px;
}

/* ===== ANIMATIONS ===== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 217, 255, 0.8);
    }
}



/* === Giữ nút chủ đề trên 1 hàng, ẩn thanh kéo ngang === */
.buttons .button-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -ms-overflow-style: none;  /* Ẩn scrollbar IE/Edge cũ */
  scrollbar-width: none;     /* Ẩn scrollbar Firefox */
}
.buttons .button-wrapper::-webkit-scrollbar {
  display: none;             /* Ẩn scrollbar Chrome/Safari */
}

.buttons .category-btn {
  flex: 0 0 auto;            /* Không co giãn */
  white-space: nowrap;       /* Giữ text trên 1 dòng */
}

/* Ẩn dropdown trên desktop */
@media (min-width: 769px) {
  .category-select-wrapper { display: none; }
}



.category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.category-btn .cat-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.3));
}

@media (max-width: 768px) {
  .category-btn .cat-icon {
    width: 18px;
    height: 18px;
  }
}



/* === Fix căn giữa & tỉ lệ QR, tối ưu layout popup Contact === */

/* Card thoáng hơn một chút */
.contact-popup .popup-card{
  padding: 24px 24px 20px;
}

/* Khung QR luôn vuông, ở chính giữa, có nền trắng & bóng nhẹ */
.qr-wrap{
  width: clamp(200px, 38vw, 260px);   /* co giãn hợp lý desktop/mobile */
  aspect-ratio: 1 / 1;               /* luôn vuông */
  display: grid;
  place-items: center;               /* giữa tuyệt đối cả 2 chiều */
  margin: 16px auto 10px;            /* auto để căn giữa theo chiều ngang */
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.06);
}
.qr-wrap img{
  width: 100%;
  height: 100%;
  object-fit: contain;               /* giữ tỉ lệ QR */
  display: block;                    /* bỏ khoảng trắng inline */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;      /* nét hơn với QR */
}

/* Lưới nút đều hàng, cao bằng nhau, thẳng cột Copy */
.action-grid{
  display: grid;
  grid-template-columns: 1fr 120px;  /* cột trái nút chính, cột phải nút copy cố định */
  gap: 10px 12px;
  align-items: stretch;              /* cùng chiều cao */
  margin-top: 16px;
}

.btn.pill{
  min-height: 44px;
  line-height: 1.15;
}

/* Tăng độ tương phản nút khi focus/hover để UX rõ hơn */
.btn.pill:focus-visible{
  outline: 2px solid rgba(0,200,255,.75);
  outline-offset: 2px;
}

/* Giảm giãn cách dưới cùng cho gọn mắt */
.hint{
  margin-top: 12px;
}


/* === Fix căn giữa & tỉ lệ QR, tối ưu layout popup Contact === */

/* Card thoáng hơn một chút */
.contact-popup .popup-card{
  padding: 24px 24px 20px;
}

/* Khung QR luôn vuông, ở chính giữa, có nền trắng & bóng nhẹ */
.qr-wrap{
  width: clamp(200px, 38vw, 260px);   /* co giãn hợp lý desktop/mobile */
  aspect-ratio: 1 / 1;               /* luôn vuông */
  display: grid;
  place-items: center;               /* giữa tuyệt đối cả 2 chiều */
  margin: 16px auto 10px;            /* auto để căn giữa theo chiều ngang */
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.06);
}
.qr-wrap img{
  width: 100%;
  height: 100%;
  object-fit: contain;               /* giữ tỉ lệ QR */
  display: block;                    /* bỏ khoảng trắng inline */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;      /* nét hơn với QR */
}

/* Lưới nút đều hàng, cao bằng nhau, thẳng cột Copy */
.action-grid{
  display: grid;
  grid-template-columns: 1fr 120px;  /* cột trái nút chính, cột phải nút copy cố định */
  gap: 10px 12px;
  align-items: stretch;              /* cùng chiều cao */
  margin-top: 16px;
}

.btn.pill{
  min-height: 44px;
  line-height: 1.15;
}

/* Tăng độ tương phản nút khi focus/hover để UX rõ hơn */
.btn.pill:focus-visible{
  outline: 2px solid rgba(0,200,255,.75);
  outline-offset: 2px;
}

/* Giảm giãn cách dưới cùng cho gọn mắt */
.hint{
  margin-top: 12px;
}


/* ===== Contact Modal – Glass UI ===== */
.contact-popup {
  position: fixed; inset: 0;
  background: rgba(5, 8, 20, 0.6);
  backdrop-filter: blur(6px);
  display: none; /* show bằng JS */
  align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}

.contact-popup .popup-card {
  position: relative;
  width: min(520px, 92vw);
  background: linear-gradient(180deg, rgba(25,30,55,.9), rgba(15,18,38,.95));
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(0,200,255,.06) inset;
  color: #fff;
  padding: 22px 22px 18px;
  animation: popupIn .25s ease-out both;
}

@keyframes popupIn {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to   { transform: translateY(0)   scale(1);   opacity: 1; }
}

.popup-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 10px;
  border: 0; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.08);
  transition: background .2s ease, transform .1s ease;
}
.popup-close:hover { background: rgba(255,255,255,.16); }
.popup-close:active { transform: scale(.96); }

.popup-header { text-align: center; margin: 6px 0 10px; }
.popup-header .badge{
  display:inline-block; font-size:12px; letter-spacing:.4px;
  padding: 4px 9px; border-radius:999px;
  background: linear-gradient(90deg,#00d4ff33,#7aa7ff33);
  border:1px solid rgba(255,255,255,.15); margin-bottom:8px;
}
.popup-header h2 { font-size:20px; margin: 0; }
.popup-header .subtitle{ opacity:.8; font-size:14px; margin-top:6px; }

.qr-wrap{
  display:flex; justify-content:center; align-items:center;
  margin:14px 0 6px;
}
.qr-wrap img{
  width: 220px; height: 220px; object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

.action-grid{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  margin-top: 14px;
}

.btn.pill{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 14px; border-radius: 999px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
}
.btn.pill:active{ transform: scale(.98); }

.btn.telegram{
  background: linear-gradient(90deg,#2ea6ff,#1283ff);
  box-shadow: 0 0 14px rgba(18,131,255,.35);
}
.btn.whatsapp{
  background: linear-gradient(90deg,#22c55e,#16a34a);
  box-shadow: 0 0 14px rgba(34,197,94,.35);
}
.btn.ghost{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.btn.telegram:hover{ filter: brightness(1.06); box-shadow:0 0 18px rgba(18,131,255,.6); }
.btn.whatsapp:hover{ filter: brightness(1.06); box-shadow:0 0 18px rgba(34,197,94,.6); }
.btn.ghost:hover{ background: rgba(255,255,255,.12); }

.hint{
  text-align:center; opacity:.7; font-size:12.5px; margin-top: 10px;
}

/* Close when clicking outside card (cursor feedback) */
.contact-popup { cursor: pointer; }
.contact-popup .popup-card { cursor: default; }
/* ===== END OF OPTIMIZED THEME ===== */

/* ===== Pagination — pill buttons, dark theme ===== */
.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  margin: 18px 0 8px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg,#1a3b7a 0%, #0d2049 100%);
  color: #eaf2ff;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: filter .2s ease, box-shadow .2s ease, transform .1s ease;
}

/* Dấu "..." */
.pagination span{
  background: transparent;
  border-color: transparent;
  color: rgba(255,255,255,.6);
  min-width: 28px;
  padding: 0 6px;
}

/* Hover / Active / Current page */
.pagination a:hover{
  filter: brightness(1.08);
  box-shadow: 0 0 14px rgba(0,200,255,.45);
}
.pagination a:active{
  transform: scale(.97);
}
.pagination a.active,
.pagination a[aria-current="page"]{
  background: linear-gradient(180deg,#4db8ff 0%, #194b99 100%);
  box-shadow: 0 0 18px rgba(0,191,255,.6), inset 0 0 4px rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.25);
  color:#fff;
}

/* Nút Previous/Next có icon */
.pagination a[aria-label="Previous page"],
.pagination a[aria-label="Next page"]{
  padding: 0 16px;
}

/* Ngăn style ngoài "reset" phá hủy */
.pagination a:link,
.pagination a:visited{ color: inherit; }

/* ===== CÂN BẰNG HEADER LAYOUT ===== */
.site-header .header-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(450px, 700px) minmax(auto, 580px);
  align-items: center;
  column-gap: 16px;
}

/* Logo */
.site-header .brand {
  margin-right: 0;
  display: flex;
  align-items: center;
  justify-self: start;
}

/* Search bar - căn giữa */
.site-header .search-bar {
  justify-self: center;
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 10px;
}

/* Menu buttons - căn phải và sát lại */
.site-header .header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: 0;
}

/* Responsive - dưới 1024px chuyển sang layout dọc */
@media (max-width: 1024px) {
  .site-header .header-wrap {
    grid-template-columns: 1fr;
    row-gap: 12px;
    padding: 10px 16px;
  }
  
  .site-header .brand {
    justify-self: center;
  }
  
  .site-header .header-right {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .site-header .header-wrap {
    padding: 8px 12px;
  }
  
  .site-header .header-right {
    gap: 8px;
  }
  
  .site-header .header-right a,
  .site-header .header-right button {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== MOBILE DISCORD OPTIMIZATION ===== */
@media (max-width: 1200px) {
    #left-sidebar {
        transform: translateX(-100%) !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 320px !important;
        z-index: 1002 !important;
    }
    
    #left-sidebar.show-mobile {
        transform: translateX(0) !important;
    }
    
    .tight-space {
        margin-left: 0 !important;
    }
    
    #toggle-widget {
        display: none !important;
    }
    
    .mobile-discord-toggle {
        position: fixed;
        left: 16px;
        bottom: 90px;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #5865F2, #4752C4);
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 4px 20px rgba(88, 101, 242, 0.7);
        border: 3px solid rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
    }
    
    .mobile-discord-toggle:hover {
        transform: scale(1.1);
    }
    
    .mobile-discord-toggle i {
        font-size: 28px;
        color: white;
    }
    
    .discord-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(6px);
        z-index: 1001;
        display: none;
    }
    
    .discord-overlay.active {
        display: block;
    }
    
    #left-sidebar .mobile-close-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        background: rgba(255, 59, 48, 0.2);
        border: 2px solid rgba(255, 59, 48, 0.5);
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s ease;
    }
    
    #left-sidebar .mobile-close-btn:hover {
        background: rgba(255, 59, 48, 0.9);
        transform: rotate(90deg);
    }
    
    #left-sidebar .mobile-close-btn i {
        font-size: 22px;
        color: white;
    }
    
    .discord-widget {
        padding-top: 60px !important;
    }
}

body.discord-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    #left-sidebar {
        width: 90% !important;
        max-width: 300px !important;
    }
    
    .mobile-discord-toggle {
        width: 56px;
        height: 56px;
    }
}