@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=JetBrains+Mono:wght@300;500&family=Syncopate:wght@700&display=swap');

:root {
    --bg-deep: #020205;
    --bg-card: rgba(6, 6, 12, 0.9);
    --glass-edge: rgba(0, 240, 255, 0.2);
    --accent-primary: #a700ff;
    /* Hyper Purple */
    --accent-secondary: #00f0ff;
    /* Cyber Cyan */
    --accent-vibrant: #ff0055;
    /* Glitch Red/Pink */
    --text-primary: #ffffff;
    --text-secondary: #8b9bb4;
    --success: #00ffa3;
    --warning: #ffcc00;
    --danger: #ff0033;
    --nav-width: 280px;
    --neon-blue: 0 0 15px rgba(0, 240, 255, 0.4);
    --neon-purple: 0 0 15px rgba(167, 0, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-image: radial-gradient(circle at 50% 50%, rgba(13, 13, 20, 1) 0%, rgba(2, 2, 5, 1) 100%);
}

/* --- CYBER BACKGROUND --- */
.cyber-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #000;
}

/* 3D Moving Grid */
.grid-container {
    position: absolute;
    bottom: -30%;
    left: -50%;
    width: 200%;
    height: 100%;
    perspective: 500px;
    opacity: 0.15;
}

.grid {
    width: 100%;
    height: 200%;
    background-image:
        linear-gradient(var(--accent-secondary) 1px, transparent 1px),
        linear-gradient(90deg, var(--accent-secondary) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(60deg);
    animation: grid-move 20s linear infinite;
    box-shadow: 0 0 50px var(--accent-secondary);
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 60px;
    }
}

/* Digital Noise Overlay */
.noise {
    position: absolute;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 10;
}

.bg-blobs {
    position: absolute;
    inset: 0;
    z-index: -1;
    filter: blur(140px) saturate(2.5);
    opacity: 0.4;
}

.blob {
    position: absolute;
    width: 65vw;
    height: 65vw;
    mix-blend-mode: color-dodge;
    animation: mutate 35s infinite alternate ease-in-out;
}


.blob-1 {
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    animation-delay: -8s;
}

.blob-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--accent-vibrant) 0%, transparent 60%);
    opacity: 0.2;
    animation: mutate 20s infinite alternate-reverse ease-in-out;
}

/* --- LOADER OVERLAY --- */
/* --- LOADER OVERLAY --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #020205;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: none;
    /* CSS Failsafe: Hide loader after 6s if JS fails */
    animation: loaderFailsafe 0.1s 6s forwards;
    pointer-events: none;
    /* Allow clicks to pass through if opacity is 0 */
}

/* Re-enable pointer events for content inside */
.loader-content {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@keyframes loaderFailsafe {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.glitch-text {
    font-family: 'Syncopate', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    position: relative;
    letter-spacing: 8px;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020205;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff0055;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00f0ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.loading-bar {
    width: 400px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress {
    width: 0%;
    height: 100%;
    background: var(--accent-secondary);
    box-shadow: 0 0 15px var(--accent-secondary);
    animation: load-progress 0.4s linear forwards;
}

.status-text {
    font-family: 'JetBrains Mono';
    font-size: 12px;
    color: var(--accent-secondary);
    letter-spacing: 4px;
    opacity: 0.8;
}

/* Transitions for Content */
#login-container,
#dashboard {
    /* Visible by default (in case JS fails) */
    opacity: 1;
    transition: all 1s ease-out;
}

#login-container.js-hidden,
#dashboard.js-hidden {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.95);
}

#login-container.visible,
#dashboard.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@keyframes load-progress {
    0% {
        width: 0%;
    }

    40% {
        width: 50%;
    }

    100% {
        width: 100%;
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(38px, 9999px, 81px, 0);
        transform: skew(0.6deg);
    }

    5% {
        clip: rect(66px, 9999px, 92px, 0);
        transform: skew(0.6deg);
    }

    10% {
        clip: rect(10px, 9999px, 35px, 0);
        transform: skew(0.53deg);
    }

    100% {
        clip: rect(44px, 9999px, 78px, 0);
        transform: skew(0.18deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Scanline Effect Overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.08) 0px,
            rgba(0, 0, 0, 0.08) 1px,
            transparent 1px,
            transparent 2px);
    z-index: 1000;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes mutate {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: rotate(0deg);
        opacity: 0.5;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(180deg);
        opacity: 0.8;
    }
}

/* --- UI COMPONENTS --- */

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-edge);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    position: relative;
}

/* Cyber Corners Effect */
.glass::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 15px;
    height: 15px;
    border-top: 2px solid var(--accent-secondary);
    border-left: 2px solid var(--accent-secondary);
    pointer-events: none;
}

.glass::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
    pointer-events: none;
}

/* --- LOGIN (ILLUMINATED) --- */
#login-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    padding: 60px 40px;
    border-radius: 4px;
    /* Hard corners for cyber feel */
    text-align: center;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 10px);
}

#login-container h1 {
    font-family: 'Syncopate', sans-serif;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 0 0 15px var(--accent-secondary);
}

#login-container p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group input {
    width: 100%;
    margin-bottom: 15px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-edge);
    border-radius: 12px;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    transition: 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    background: rgba(0, 240, 255, 0.05);
}

#login-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 1px solid var(--accent-secondary);
    border-radius: 12px;
    color: var(--accent-secondary);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1);
}

#login-btn:hover {
    background: var(--accent-secondary);
    color: #000;
    box-shadow: 0 0 30px var(--accent-secondary);
}

/* --- DASHBOARD LAYOUT --- */
#dashboard {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    height: 100vh;
    padding: 15px;
    gap: 15px;
}

.sidebar {
    padding: 30px 15px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%);
}

.logo {
    font-family: 'Syncopate', sans-serif;
    font-size: 18px;
    color: #fff;
    margin-bottom: 40px;
    text-align: left;
    padding-left: 10px;
    border-left: 3px solid var(--accent-secondary);
    position: relative;
    transition: 0.1s;
}

.logo span {
    color: var(--accent-secondary);
    font-size: 12px;
}

.logo::after {
    content: "SYSTEM_ACTIVE";
    position: absolute;
    bottom: -15px;
    left: 10px;
    font-size: 8px;
    font-family: 'JetBrains Mono';
    color: var(--success);
    letter-spacing: 1px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    border: 1px solid transparent;
}

.nav-item .icon {
    font-size: 14px;
    opacity: 0.5;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-secondary);
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

.nav-item.active {
    border-right: 3px solid var(--accent-secondary);
    box-shadow: inset -10px 0 20px rgba(0, 240, 255, 0.05);
    background: rgba(0, 240, 255, 0.08);
}

.logout {
    margin-top: auto;
    color: var(--accent-vibrant);
}

.logout:hover {
    background: rgba(255, 0, 85, 0.05);
    border-color: rgba(255, 0, 85, 0.15);
    color: #fff;
}

/* SYSTEM MONITOR */
.system-monitor {
    margin-top: 25px;
    padding: 20px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--glass-edge);
}

.status-line {
    margin-bottom: 15px;
}

.status-line .label {
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.status-line .bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.status-line .fill {
    height: 100%;
    background: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary);
}

.status-line .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

/* --- CONTENT AREA --- */
.content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

/* TOP BAR */
.top-bar {
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.breadcrumb {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.breadcrumb span {
    color: var(--accent-secondary);
    font-weight: 700;
}

.server-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.server-info .stat {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.server-info .time {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-secondary);
    font-size: 14px;
    font-weight: 700;
}

.main-view {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.main-view::-webkit-scrollbar {
    width: 3px;
}

.main-view::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
}

header {
    margin-bottom: 25px;
}

/* STATS */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.card {
    padding: 25px;
    text-align: left;
    border-radius: 4px;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%);
    position: relative;
    overflow: hidden;
}

.card-deco {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--accent-secondary);
    border-right: 2px solid var(--accent-secondary);
    opacity: 0.3;
}

.card h3 {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.card span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
}

.green-text {
    color: var(--success);
}

/* --- TABLES --- */
.table-card {
    padding: 30px;
    border-radius: 4px;
    min-height: 500px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-edge);
    padding-bottom: 15px;
}

.table-header h2 {
    font-family: 'Syncopate', sans-serif;
    font-size: 16px;
    color: var(--accent-secondary);
    letter-spacing: 2px;
}

.search-box input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-edge);
    padding: 10px 20px;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    width: 250px;
}

.table-card h2 {
    font-family: 'Syncopate', sans-serif;
    font-size: 18px;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: var(--accent-secondary);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--glass-edge);
}

td {
    padding: 18px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 12px;
    color: #fff;
}

tr:hover td {
    background: rgba(0, 240, 255, 0.03);
}

/* BADGES */
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    border: 1px solid;
}

.badge.active {
    color: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 10px rgba(0, 255, 163, 0.1);
}

.badge.banned {
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
}

.badge.pending {
    color: var(--warning);
    border-color: var(--warning);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.badge.frozen {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.product-tag {
    font-size: 8px;
    background: rgba(0, 240, 255, 0.05);
    padding: 2px 6px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono';
    margin-right: 5px;
}

/* BUTTONS */
.btn-small {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--glass-edge);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 8px;
    text-transform: uppercase;
}

.btn-small:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.bg-blue {
    background: rgba(0, 210, 255, 0.2) !important;
    color: var(--accent-secondary) !important;
    border-color: rgba(0, 240, 255, 0.2) !important;
}

.bg-blue:hover {
    border-color: var(--accent-secondary);
    background: var(--accent-secondary);
}

.bg-red {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--accent-vibrant) !important;
    border-color: rgba(255, 0, 85, 0.2) !important;
}

.bg-red:hover {
    border-color: var(--danger);
    background: var(--danger);
}

/* --- OFFSETS & JSON --- */
#offsets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.offset-edit h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

textarea {
    width: 100%;
    height: 450px;
    background: #000;
    border: 1px solid var(--accent-secondary);
    border-radius: 12px;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 20px;
    margin-bottom: 15px;
    resize: vertical;
    margin-top: 20px;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary);
}

.hidden {
    display: none !important;
}

/* --- ANIMATIONS & INTERACTIVITY --- */

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--accent-secondary);
    }

    50% {
        box-shadow: 0 0 25px var(--accent-secondary), 0 0 10px var(--accent-secondary) inset;
    }
}

@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hologram-flicker {
    0% {
        opacity: 0.9;
    }

    5% {
        opacity: 0.8;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.5;
    }

    20% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.9;
    }

    55% {
        opacity: 0.7;
    }

    60% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.9;
    }
}

@keyframes slide-up-center {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Apply Entrance Animations - Elements fade in and slide up */
.glass {
    opacity: 0;
    /* Start hidden for animation */
    /* Ultra-fast animation: 0.1s */
    animation: slide-up-fade 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Override for centered Login Container */
#login-container {
    animation: slide-up-center 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Stagger entrance for visual flair */
.wrapper>.glass:nth-child(1) {
    animation-delay: 0.1s;
}

.wrapper>.glass:nth-child(2) {
    animation-delay: 0.2s;
}

.wrapper>.glass:nth-child(3) {
    animation-delay: 0.3s;
}

.nav-item {
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    transform: translateX(5px);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.1), transparent);
    border-left-color: var(--accent-secondary);
    text-shadow: 0 0 8px var(--accent-secondary);
}

.nav-item.active {
    animation: pulse-glow 2s infinite;
}

/* Interactive Buttons */
#login-btn,
.btn-small {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#login-btn::before,
.btn-small::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

#login-btn:hover::before,
.btn-small:hover::before {
    left: 100%;
}

#login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 240, 255, 0.4);
    text-shadow: 0 0 8px #fff;
}

/* Inputs Glow */
.input-group input:focus {
    transform: scale(1.02);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
}

/* Table Enhancements */
tr {
    transition: 0.2s;
    cursor: default;
}

tr:hover td {
    color: #fff;
    background: rgba(0, 240, 255, 0.05);
    text-shadow: 0 0 5px var(--accent-secondary);
}

/* Logo Flicker */
.logo {
    animation: hologram-flicker 5s infinite;
}

/* Status Bar Pulse */
.status-line .fill {
    animation: pulse-glow 3s infinite alternate;
}