/* assets/css/components.css — เมนูสไลด์ / popup ตั้งค่า / modal / ธีมมืด(เข้มพิเศษ) / สถิติ / payment logos
 * โทนสีเดียวกับ style.css (ธีมม่วง-ชมพูเข้มของทั้งเว็บ) */

/* ---------- เมนูสไลด์จากขวา ---------- */
.side-menu-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: none; z-index: 1400;
}
.side-menu-backdrop.open { display: block; }

.side-menu {
    position: fixed; top: 0; right: 0; height: 100vh; width: 300px;
    background: var(--shop-surface, #150f28); color: var(--shop-text, #f5f3ff);
    border-left: 1px solid var(--shop-border, rgba(255,255,255,.08));
    z-index: 1500;
    transform: translateX(100%); transition: transform .25s ease;
    overflow-y: auto; box-shadow: -6px 0 24px rgba(0,0,0,.4);
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--shop-border, rgba(255,255,255,.08));
}
.side-menu-logo { max-height: 40px; }
.side-menu-brand { font-weight: 700; font-size: 1.1rem; }
.side-menu-close {
    background: var(--shop-surface-2, #1d1638); color: var(--shop-text, #f5f3ff);
    border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 999px; width: 34px; height: 34px; cursor: pointer;
}

.side-menu-nav { display: flex; flex-direction: column; padding: 14px; gap: 6px; }
.side-menu-nav a, .side-menu-nav button.side-menu-settings-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px; text-decoration: none;
    color: var(--shop-text, #f5f3ff); background: var(--shop-surface-2, #1d1638);
    border: 1px solid transparent;
    font-family: 'Kanit', sans-serif; font-size: .95rem; cursor: pointer; text-align: left;
}
.side-menu-nav a:hover, .side-menu-nav button.side-menu-settings-btn:hover {
    border-color: rgba(139,92,246,.4);
}
.side-menu-nav .side-menu-section-title {
    font-size: .75rem; color: var(--shop-muted, #9c8fc2); text-transform: uppercase;
    margin: 10px 4px 0;
}
.side-menu-nav .side-menu-cta {
    background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899));
    color: #fff;
}
.side-menu-nav hr { border: none; border-top: 1px solid var(--shop-border, rgba(255,255,255,.08)); margin: 8px 4px; }

/* ---------- Popup ตั้งค่า ---------- */
.settings-popup-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: none; z-index: 1600;
}
.settings-popup-backdrop.open { display: block; }
.settings-popup {
    position: fixed; top: 90px; right: 20px;
    background: var(--shop-surface, #150f28); color: var(--shop-text, #f5f3ff);
    border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 16px;
    padding: 18px; width: 260px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
    z-index: 1700; display: none;
}
.settings-popup.open { display: block; }
.settings-popup-title { font-size: .8rem; color: var(--shop-muted, #9c8fc2); margin: 10px 0 6px; }
.settings-toggle-group { display: flex; gap: 6px; }
.locale-btn {
    flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    background: var(--shop-surface-2, #1d1638); color: var(--shop-text, #f5f3ff); cursor: pointer; font-family: 'Kanit', sans-serif;
}
.locale-btn.active { background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899)); color: #fff; border-color: transparent; }

/* ---------- Modal เข้าสู่ระบบ/สมัครสมาชิก ---------- */
.auth-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: none; z-index: 1800;
}
.auth-modal-backdrop.open { display: block; }
.auth-modal {
    position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
    z-index: 1900; padding: 20px;
}
.auth-modal.open { display: flex; }
.auth-modal-box {
    background: var(--shop-surface, #150f28); color: var(--shop-text, #f5f3ff);
    border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 18px; padding: 26px; max-width: 420px; width: 100%;
}
.auth-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.auth-modal-header button { background: none; border: none; color: var(--shop-text, #f5f3ff); font-size: 1.1rem; cursor: pointer; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
    flex: 1; padding: 10px; border-radius: 999px; border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    background: var(--shop-surface-2, #1d1638); color: var(--shop-text, #f5f3ff); cursor: pointer; font-family: 'Kanit', sans-serif;
}
.auth-tab.active { background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899)); color: #fff; border-color: transparent; }
.auth-modal-message { padding: 10px 12px; border-radius: 10px; background: var(--shop-surface-2, #1d1638); margin-bottom: 12px; font-size: .9rem; }

/* ---------- Modal เติมเงิน (ข้อ 4/5/6 — แยกออกจากหน้าโปรไฟล์ เป็นป็อปอัพแทน) ---------- */
.topup-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: none; z-index: 1800;
}
.topup-modal-backdrop.open { display: block; }
.topup-modal {
    position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
    z-index: 1900; padding: 20px; overflow-y: auto;
}
.topup-modal.open { display: flex; }
.topup-modal-box {
    background: var(--shop-surface, #150f28); color: var(--shop-text, #f5f3ff);
    border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 18px; padding: 26px; max-width: 460px; width: 100%; margin: auto;
}
.topup-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.topup-modal-header button { background: none; border: none; color: var(--shop-text, #f5f3ff); font-size: 1.1rem; cursor: pointer; }
.topup-modal-message { padding: 10px 12px; border-radius: 10px; background: var(--shop-surface-2, #1d1638); margin-bottom: 12px; font-size: .9rem; }
.topup-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.topup-tab {
    flex: 1; padding: 10px; border-radius: 999px; border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    background: var(--shop-surface-2, #1d1638); color: var(--shop-text, #f5f3ff); cursor: pointer; font-family: 'Kanit', sans-serif;
}
.topup-tab.active { background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899)); color: #fff; border-color: transparent; }
.topup-submode { display: flex; gap: 8px; margin-bottom: 14px; }
.topup-submode label {
    flex: 1; text-align: center; padding: 8px; border-radius: 10px; cursor: pointer; font-size: .85rem;
    border: 1px solid var(--shop-border, rgba(255,255,255,.08)); background: var(--shop-surface-2, #1d1638);
}
.topup-submode input { display: none; }
.topup-submode input:checked + span { color: #fff; }
.topup-submode label.active { background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899)); border-color: transparent; }
.bank-info-card {
    background: var(--shop-surface-2, #1d1638); border-radius: 12px; padding: 14px; margin-bottom: 14px; font-size: .9rem;
}
.bank-info-card .row { display: flex; justify-content: space-between; padding: 3px 0; }
.bank-info-card .row .label { color: var(--shop-muted, #9c8fc2); }
.bank-info-card img.qr { display: block; max-width: 160px; margin: 10px auto 0; border-radius: 8px; }
.file-drop {
    border: 1px dashed var(--shop-border, rgba(255,255,255,.15)); border-radius: 12px; padding: 16px; text-align: center;
    cursor: pointer; font-size: .85rem; color: var(--shop-muted, #9c8fc2); margin-bottom: 12px;
}
.file-drop img { max-width: 100%; max-height: 160px; border-radius: 8px; margin-top: 8px; }

/* ---------- ธีม "เข้มพิเศษ" (ตัวเลือกในตั้งค่า) — เข้มยิ่งกว่าดีฟอลต์ (ปิดไล่สีพื้นหลังส่วน hero) ---------- */
body.theme-dark { background: #050308; }
body.theme-dark .shop-hero { background: #050308; }
body.theme-dark .shop-card, body.theme-dark .feature-card, body.theme-dark .website-card,
body.theme-dark .side-menu, body.theme-dark .settings-popup, body.theme-dark .auth-modal-box {
    background: #0d0a1a; border-color: rgba(255,255,255,.06);
}

/* ---------- สถิติหน้าแรก ---------- */
.stats-hero-card {
    background: var(--shop-surface, #150f28); border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 20px; padding: 24px; text-align: center;
    box-shadow: 0 2px 16px rgba(0,0,0,.25); margin: 20px 0;
}
.stats-hero-card .big-number {
    font-size: 2.2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 12px; margin: 20px 0; }
.stats-grid .stat-box {
    background: var(--shop-surface, #150f28); border: 1px solid var(--shop-border, rgba(255,255,255,.08));
    border-radius: 14px; padding: 16px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.stats-grid .stat-box .num {
    font-size: 1.6rem; font-weight: 800;
    background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-grid .stat-box .lbl { font-size: .8rem; color: var(--shop-muted, #9c8fc2); }

/* ---------- โลโก้ธนาคาร/ช่องทางชำระเงิน ---------- */
.payment-logos-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(70px,1fr)); gap: 12px;
    margin-top: 16px;
}
.payment-logos-grid img {
    width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: contain;
    background: var(--shop-surface-2, #1d1638); padding: 8px;
}

/* ---------- ปุ่มเพลงพื้นหลัง (มุมล่างขวา) ---------- */
.bg-music-toggle {
    position: fixed; right: 20px; bottom: 20px; z-index: 1300;
    width: 52px; height: 52px; border-radius: 50%; border: none;
    background: var(--shop-surface, #150f28); color: var(--shop-muted, #9c8fc2);
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    cursor: pointer; transition: transform .15s ease, color .15s ease;
}
.bg-music-toggle:hover { transform: scale(1.06); }
.bg-music-toggle.playing {
    color: #fff;
    background: linear-gradient(135deg, var(--shop-primary, #8b5cf6), var(--shop-secondary, #ec4899));
    animation: bg-music-pulse 2s ease-in-out infinite;
}
@keyframes bg-music-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(139,92,246,.4); }
    50% { box-shadow: 0 6px 28px rgba(236,72,153,.6); }
}

/* ---------- Decor effect canvas (particles/snow) ---------- */
/* z-index ติดลบ = วาดอยู่หลังเนื้อหาปกติทั้งหมดตามลำดับ stacking ของ CSS (ไม่บังการ์ด/ปุ่ม) */
#decorEffectCanvas {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

/* ---------- โลโก้แบบมีอนิเมชัน (หน้า login/register/auth modal) ---------- */
.auth-logo { max-width: 120px; margin: 0 auto 16px; display: block; }
.auth-logo.anim-float { animation: auth-logo-float 3s ease-in-out infinite; }
.auth-logo.anim-pulse { animation: auth-logo-pulse 2s ease-in-out infinite; }
.auth-logo.anim-spin { animation: auth-logo-spin 6s linear infinite; }
.auth-logo.anim-bounce { animation: auth-logo-bounce 1.4s ease-in-out infinite; }
@keyframes auth-logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes auth-logo-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes auth-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes auth-logo-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
