@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0F0F0F;
    --bg-card: #141414;
    --bg-card-hover: #1b1b1f;
    --primary: #4200bb;
    --primary-hover: #5a20d2;
    --secondary: #4200bb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #242428;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.panel-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(66, 0, 187, 0.18), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.12), transparent 24%),
        radial-gradient(circle at 50% 78%, rgba(66, 0, 187, 0.12), transparent 30%),
        linear-gradient(180deg, #030303 0%, #060606 45%, #020202 100%);
}

.panel-overlay__aurora,
.panel-overlay__particles,
.panel-overlay__scanlines,
.panel-overlay__glow {
    position: absolute;
    inset: 0;
}

.panel-overlay__aurora {
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 225, 255, 0.12), transparent 22%),
        radial-gradient(circle at 78% 24%, rgba(66, 0, 187, 0.18), transparent 26%),
        radial-gradient(circle at 60% 76%, rgba(0, 225, 255, 0.08), transparent 24%);
    filter: blur(32px);
    opacity: 0.95;
    animation: panelAuroraMove 12s ease-in-out infinite alternate;
}

.panel-overlay__particles {
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 1.8px),
        radial-gradient(circle, rgba(255,255,255,0.8) 0 1px, transparent 1.6px),
        radial-gradient(circle, rgba(120, 255, 255, 0.65) 0 1px, transparent 1.5px);
    background-size: 130px 130px, 210px 210px, 280px 280px;
    background-position: 0 0, 45px 60px, 100px 120px;
    opacity: 0.4;
    animation: panelParticlesDrift 16s linear infinite;
}

.panel-overlay__scanlines {
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255,255,255,0.028) 0 1px,
            transparent 1px 24px
        ),
        linear-gradient(120deg, transparent 15%, rgba(255,255,255,0.05) 50%, transparent 85%);
    mix-blend-mode: screen;
    opacity: 0.24;
    animation: panelScanMove 7s linear infinite;
}

.panel-overlay__glow {
    inset: 18px;
    border-radius: 34px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    box-shadow:
        0 0 0 1px rgba(34, 211, 238, 0.04),
        0 0 28px rgba(34, 211, 238, 0.14),
        inset 0 0 30px rgba(34, 211, 238, 0.04);
    animation: panelGlowPulse 4s ease-in-out infinite;
}

@keyframes panelAuroraMove {
    0% {
        transform: translate3d(-2%, -1%, 0) scale(1);
    }
    50% {
        transform: translate3d(2%, 1%, 0) scale(1.06);
    }
    100% {
        transform: translate3d(-1%, 2%, 0) scale(1.02);
    }
}

@keyframes panelParticlesDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(-18px, 32px, 0) scale(1.02);
    }
    100% {
        transform: translate3d(-36px, 64px, 0) scale(1);
    }
}

@keyframes panelScanMove {
    0% {
        transform: translate3d(0, -20px, 0);
        opacity: 0.16;
    }
    50% {
        transform: translate3d(0, 0, 0);
        opacity: 0.26;
    }
    100% {
        transform: translate3d(0, 20px, 0);
        opacity: 0.16;
    }
}

@keyframes panelGlowPulse {
    0%, 100% {
        opacity: 0.72;
        box-shadow:
            0 0 0 1px rgba(34, 211, 238, 0.04),
            0 0 28px rgba(34, 211, 238, 0.14),
            inset 0 0 30px rgba(34, 211, 238, 0.04);
    }
    50% {
        opacity: 1;
        box-shadow:
            0 0 0 1px rgba(34, 211, 238, 0.08),
            0 0 42px rgba(34, 211, 238, 0.22),
            inset 0 0 42px rgba(34, 211, 238, 0.08);
    }
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(10, 10, 10, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 0 24px 24px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    text-align: center;
}

.sidebar-header span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo {
    width: 160px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 6px auto 0;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

.nav-links {
    list-style: none;
    flex: 1;
    padding: 0 16px;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(66, 0, 187, 0.18);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
}

/* Cards & Widgets */
.grid-3, .grid-4 {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}
.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px -12px rgba(66, 0, 187, 0.42);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
}

/* Tables */
.card-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge.alive { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge.dead { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge.pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Buttons & Inputs */
.btn {
    padding: 12px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(66, 0, 187, 0.25);
}

body.gp-modal-open {
    overflow: hidden;
}

.gp-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}

.gp-modal-overlay.is-open {
    display: flex;
}

.gp-modal {
    width: min(520px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.65);
    max-height: calc(100dvh - 48px);
    overflow: auto;
}

.gp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-card);
    padding: 6px 0;
    border-bottom: 1px solid rgba(66, 0, 187, 0.22);
}

.gp-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gp-modal-close:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.20);
}

@media (max-width: 520px) {
    .gp-modal-overlay {
        padding: 12px;
    }
    .gp-modal {
        padding: 20px;
        border-radius: 14px;
    }
}
