:root { 
    --theme-primary: #9d00ff; 
    --theme-glow: rgba(157, 0, 255, 0.5);
    --dark-bg: #050505; 
    --card-bg: rgba(15, 15, 20, 0.85);
    --text-main: #ffffff;
    --text-muted: #888888;
    --success-neon: #00ff88;
    --error-neon: #ff003c;
}

body { 
    background: var(--dark-bg); color: var(--text-main); 
    font-family: 'Poppins', sans-serif; 
    margin: 0; display: flex; justify-content: center; align-items: center; 
    min-height: 100vh; overflow: hidden;
    background-image: radial-gradient(circle at 50% 50%, rgba(157, 0, 255, 0.1) 0%, var(--dark-bg) 60%);
}

/* ⚡ เอฟเฟกต์เส้นสายฟ้าผ่า */
.lightning-flash {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 1; 
    animation: flashAnim 0.3s ease-out;
}
@keyframes flashAnim {
    0% { background: rgba(255, 255, 255, 0.7); }
    30% { background: rgba(157, 0, 255, 0.3); }
    100% { background: transparent; }
}

/* ✨ แจ้งเตือน Toast */
#notify-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    width: 280px; background: rgba(15, 15, 20, 0.95);
    border: 1px solid var(--theme-primary); border-radius: 8px;
    color: #fff; padding: 15px; position: relative; overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5); animation: slideIn 0.3s forwards;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.toast.hide { animation: slideOut 0.3s forwards; }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(120%); } }
.toast-content { font-size: 13px; font-weight: 500; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--theme-primary); width: 100%; animation: progressRun var(--duration) linear forwards; }
@keyframes progressRun { from { width: 100%; } to { width: 0%; } }
.toast.success { border-color: var(--success-neon); }
.toast.success .toast-progress { background: var(--success-neon); }
.toast.error { border-color: var(--error-neon); }
.toast.error .toast-progress { background: var(--error-neon); }

/* UI หลักหน้าเว็บ */
.card { 
    width: 90%; max-width: 380px; 
    background: var(--card-bg); 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-radius: 16px; padding: 40px 30px; 
    box-shadow: 0 0 30px rgba(157, 0, 255, 0.15), inset 0 0 15px rgba(157, 0, 255, 0.05); 
    border: 1px solid rgba(157, 0, 255, 0.3); 
    text-align: center; box-sizing: border-box; position: relative; z-index: 10;
}

.logo-icon { 
    width: 90px; height: 90px; margin: 0 auto 20px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; overflow: hidden;
    box-shadow: 0 0 20px var(--theme-glow); border: 2px solid var(--theme-primary);
    animation: pulseGlow 2s infinite alternate; background: #000;
}
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
@keyframes pulseGlow { 
    from { box-shadow: 0 0 10px rgba(157, 0, 255, 0.2); } 
    to { box-shadow: 0 0 25px rgba(157, 0, 255, 0.6), inset 0 0 10px rgba(157, 0, 255, 0.4); } 
}

.brand-title {
    font-family: 'Orbitron', sans-serif; font-size: 50px; font-weight: 900;
    color: #ffffff; margin: 0 0 5px 0; letter-spacing: 2px; text-transform: uppercase;
    text-shadow: 0 0 10px var(--theme-primary), 0 0 25px var(--theme-primary);
}
p.subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 25px; letter-spacing: 4px; font-weight: 600; }

input, select { 
    width: 100%; padding: 15px; margin-bottom: 20px; 
    background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); 
    color: #fff; border-radius: 10px; box-sizing: border-box; text-align: center; 
    font-size: 14px; outline: none; transition: 0.3s; letter-spacing: 1.5px; font-family: 'Poppins', sans-serif;
}
input:focus, select:focus { box-shadow: 0 0 15px rgba(157, 0, 255, 0.4); border-color: var(--theme-primary); background: rgba(0, 0, 0, 0.8); }
select { appearance: none; cursor: pointer; }
select option { background: #111; }

.btn { 
    width: 100%; padding: 16px; background: var(--theme-primary); color: #fff; 
    border: none; border-radius: 10px; font-weight: 600; font-size: 15px; 
    cursor: pointer; transition: 0.3s; letter-spacing: 1px; 
    font-family: 'Poppins', sans-serif; display: flex; justify-content: center; align-items: center;
}
.btn:hover:not(:disabled) { background: #b333ff; box-shadow: 0 0 20px var(--theme-glow); transform: translateY(-2px); }
.btn:disabled { background: #333; color: #888; cursor: not-allowed; }

.btn-import { background: var(--success-neon); color: #000; font-weight: bold; box-shadow: 0 0 15px rgba(0, 255, 136, 0.4); margin-top: 10px; }
.btn-import:hover { background: #00cc6a; box-shadow: 0 0 25px rgba(0, 255, 136, 0.6); }

/* อนิเมชั่นปุ่มเด้งดึ๋ง */
@keyframes bounceGlow {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 15px rgba(255,0,85,0.4); }
    50% { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(255,0,85,0.8); }
}
.bounce-btn {
    animation: bounceGlow 1.5s infinite ease-in-out;
    background: linear-gradient(45deg, #ff0055, #9d00ff) !important;
    border: 1px solid #ff0055 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.spinner { display: none; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid #fff; border-radius: 50%; animation: spin 1s linear infinite; margin-left: 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ข้อมูล Dashboard */
.data-box { background: rgba(0, 0, 0, 0.4); border-radius: 10px; padding: 15px; margin-bottom: 20px; border: 1px solid rgba(157, 0, 255, 0.2); }
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.data-row:last-child { border-bottom: none; }
.label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.value { font-size: 13px; color: var(--text-main); font-weight: 600; text-align: right; word-break: break-all; }

/* 💎 อัปเกรดยศให้ดูแพง (Premium Badges) */
.badge-premium {
    padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
    position: relative; overflow: hidden; z-index: 1; color: #fff;
}
.badge-premium::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg); animation: shine 3s infinite; z-index: -1;
}
@keyframes shine { 20% { left: 150%; } 100% { left: 150%; } }

.badge-v1 { background: linear-gradient(135deg, #6b0019, #ff003c); border: 1px solid #ff003c; box-shadow: 0 0 10px rgba(255,0,60,0.5); }
.badge-v2 { background: linear-gradient(135deg, #004d6b, #00d2ff); border: 1px solid #00d2ff; box-shadow: 0 0 10px rgba(0,210,255,0.5); }
.badge-v3 { background: linear-gradient(135deg, #3d006b, #9d00ff); border: 1px solid #9d00ff; box-shadow: 0 0 10px rgba(157,0,255,0.5); }
.badge-vip { background: linear-gradient(135deg, #6b5c00, #ffd700); border: 1px solid #ffd700; box-shadow: 0 0 10px rgba(255,215,0,0.5); text-shadow: 0 1px 2px #000; }

.success-box { background: rgba(0, 255, 136, 0.05); border-radius: 10px; margin: 15px 0 25px 0; border: 1px solid rgba(0, 255, 136, 0.3); box-shadow: 0 0 15px rgba(0, 255, 136, 0.15); display: none; padding: 15px; text-align: center; }

/* 📖 หน้าสอนติดตั้ง */
.tutorial-steps { max-height: 250px; overflow-y: auto; margin-bottom: 20px; padding-right: 5px; }
.step { background: rgba(0, 0, 0, 0.5); margin-bottom: 10px; padding: 12px; border-radius: 8px; border-left: 3px solid var(--theme-primary); font-size: 13px; display: flex; align-items: center; color: #ddd; }
.step span { background: var(--theme-primary); color: #fff; width: 22px; height: 22px; display: inline-flex; justify-content: center; align-items: center; border-radius: 50%; margin-right: 12px; font-weight: bold; font-size: 12px; flex-shrink: 0; box-shadow: 0 0 10px var(--theme-glow); }
.yt-link { display: flex; justify-content: center; align-items: center; background: rgba(255, 0, 60, 0.1); border: 1px solid rgba(255, 0, 60, 0.4); color: #ff3366; text-decoration: none; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: 0.3s; margin-bottom: 15px; }
.yt-link:hover { background: rgba(255, 0, 60, 0.2); box-shadow: 0 0 15px rgba(255, 0, 60, 0.4); color: #fff; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.state-error { border-color: var(--error-neon) !important; box-shadow: 0 0 40px rgba(255, 0, 60, 0.3) !important; animation: shake 0.5s ease; }
