/* ==========================================================
 * A-LONG: CYBERPUNK FAITH-TECH UI SYSTEM
 * Pure Vanilla CSS - High Performance & Mobile-First
 * ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+Thai:wght@400;600;700&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    /* Color Palette */
    --c-bg-dark: #0B0C10;
    --c-bg-light: #1F2833;
    --c-accent-cyan: #00E5FF;
    --c-accent-gold: #FFC107;
    --c-alert-red: #FF3B30;
    
    /* Text Colors */
    --c-text-main: #FFFFFF;
    --c-text-muted: #C5C6C7;
    
    /* Fonts */
    --font-ui: 'Inter', 'Noto Sans Thai', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Glass Effect */
    --glass-bg: rgba(31, 40, 51, 0.7);
    --glass-border: 1px solid rgba(0, 229, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--c-bg-dark);
    background-image: radial-gradient(circle at 50% 0%, var(--c-bg-light) 0%, var(--c-bg-dark) 80%);
    color: var(--c-text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px; /* Space for bottom nav */
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
p { font-size: 1rem; color: var(--c-text-muted); line-height: 1.5; margin-bottom: 1rem; }

.text-cyan { color: var(--c-accent-cyan); }
.text-gold { color: var(--c-accent-gold); }
.text-red { color: var(--c-alert-red); }
.font-mono { font-family: var(--font-mono); }

/* ========================================
   CONTAINERS & CARDS
   ======================================== */
.container {
    width: 100%;
    max-width: 480px; /* Mobile First Lock */
    margin: 0 auto;
    padding: 1.5rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ========================================
   GLOWING BUTTONS CTA
   ======================================== */
.btn {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: transparent;
    border: 2px solid var(--c-accent-cyan);
    color: var(--c-accent-cyan);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    min-height: 48px; /* Touch target */
}

.btn:active, .btn:hover {
    background-color: var(--c-accent-cyan);
    color: var(--c-bg-dark);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    transform: scale(0.98);
}

.btn-gold {
    border-color: var(--c-accent-gold);
    color: var(--c-accent-gold);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
}
.btn-gold:active, .btn-gold:hover {
    background-color: var(--c-accent-gold);
    color: var(--c-bg-dark);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
}

/* ========================================
   BOTTOM NAVIGATION BAR
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--c-bg-dark);
    border-top: 1px solid rgba(197, 198, 199, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--c-text-muted);
    font-size: 0.75rem;
    width: 33.33%;
    transition: color 0.3s ease;
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-item.active, .nav-item:hover {
    color: var(--c-accent-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* ========================================
   HACKING LOADER PROGRESS
   ======================================== */
#hacking-overlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(11, 12, 16, 0.96);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#hacking-overlay.active {
    visibility: visible;
    opacity: 1;
}

.progress-container {
    width: 80%;
    max-width: 300px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--c-accent-cyan);
    box-shadow: 0 0 10px var(--c-accent-cyan);
    transition: width 0.1s linear;
}

/* ========================================
   HELPER UTILITIES
   ======================================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ========================================
   FORM INPUTS & HACKING ARENA
   ======================================== */
.cyber-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(197, 198, 199, 0.2);
    color: var(--c-text-main);
    padding: 12px 16px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: all 0.3s;
}
.cyber-input:focus {
    outline: none;
    border-color: var(--c-accent-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.score-container {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.score-bar {
    height: 100%;
    width: 0%;
    background-color: var(--c-text-muted);
    transition: width 1s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* Tier Specific Colors */
.tier-1-red { background-color: var(--c-alert-red); box-shadow: 0 0 10px var(--c-alert-red); }
.tier-4-gold { background-color: var(--c-accent-gold); box-shadow: 0 0 15px var(--c-accent-gold); }
/* Shake Animation for Bad Scores */
@keyframes shakeAlert {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}
.shake-warning {
    animation: shakeAlert 0.4s ease-in-out;
}
/* 404 Error Styles */
.error-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.glitch {
    font-size: 6rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.05em 0 rgba(0, 255, 0, 0.75), 0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.05em 0 rgba(0, 255, 0, 0.75), 0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}

.error-icon {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    border: 2px solid var(--c-cyan);
}

/* ========================================
   PREMIUM GLOBAL HEADER
   ======================================== */
.premium-header {
    position: relative;
    width: 100%;
    height: 200px;
    background: url('/assets/images/header-bg-premium.png') no-repeat center center;
    background-size: cover;
    border-radius: 0 0 25px 25px;
    overflow: hidden;
    border-bottom: 2px solid var(--c-accent-cyan);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.3);
    margin-bottom: 20px;
}
.header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(11,12,16,0.95));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}
.nav-floating {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 10px 15px;
    margin-bottom: 0;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 25px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-floating::-webkit-scrollbar {
    display: none;
}
.nav-floating a {
    flex-shrink: 0; /* Prevents icons and text from squishing */
    min-width: 60px; /* Optional: gives some breathing room */
}
.nav-floating-wrapper {
    position: relative;
    width: 100%;
}
.nav-floating-wrapper::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 0;
    width: 60px;
    height: calc(100% - 10px);
    background: linear-gradient(to right, transparent, rgba(11, 12, 16, 0.9));
    pointer-events: none;
    z-index: 5;
    border-radius: 0 15px 15px 0;
}

/* PC/Tablet View Adjustments */
@media (min-width: 768px) {
    .nav-floating {
        justify-content: space-between; /* Spread items out on PC */
        overflow: visible; /* No scroll needed */
        padding: 10px 30px;
    }
    .nav-floating-wrapper::after {
        display: none; /* Hide fade-mask on PC */
    }
    .nav-floating a {
        flex: 1;
        max-width: none;
    }
}
.btn-profile-trigger {
    background: linear-gradient(135deg, #00e5ff, #8e44ad);
    border: none;
    color: white;
    padding: 0;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5), 0 0 40px rgba(142, 68, 173, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
    right: 20px;
    bottom: 75px;
    z-index: 10;
}
.btn-profile-trigger:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
}
.btn-profile-trigger:active {
    transform: scale(0.9);
}
.badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--c-alert-red);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 50%;
    border: 2px solid var(--c-bg-dark);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

/* [AI ERROR GLITCH UI] */
.glitch-card {
    background: rgba(255, 12, 16, 0.08);
    border: 2px solid rgba(255, 50, 50, 0.5);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: glitch-shake 0.3s infinite;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.2);
}

.glitch-card h4 {
    color: #ff3232;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-shadow: 2px 0 #00e5ff, -2px 0 #ff00ff;
    font-size: 1.2rem;
}

.glitch-card p {
    color: #fff;
    opacity: 0.85;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-retry {
    background: linear-gradient(135deg, #ff3232, #9013fe);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(255, 50, 50, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-retry:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 50, 50, 0.6);
}

.btn-retry:active {
    transform: translateY(1px) scale(0.95);
}

@keyframes glitch-shake {
    0% { transform: translate(0); }
    10% { transform: translate(-1px, 1px); }
    20% { transform: translate(1px, -1px) skewX(2deg); }
    30% { transform: translate(-1px, -1px); opacity: 0.9; }
    40% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, 1px) skewX(-2deg); }
    60% { transform: translate(1px, -1px); opacity: 0.8; }
    70% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
    90% { transform: translate(-1px, 1px); opacity: 0.9; }
    100% { transform: translate(0); }
}
