@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: #050505;
    background-image: url('https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdmNocDZsZzhqYWs2c2M5dDVsM3VlbDM5MDVmNzUzcWp0a3lwbDJuYyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/jaOXKCxtBPLieRLI0c/giphy.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #e2e8f0;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 50%),
        linear-gradient(180deg, rgba(5,5,5,0.7) 0%, rgba(5,5,5,0.5) 50%, rgba(5,5,5,0.7) 100%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== DESKTOP TOPBAR ==================== */
.topbar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff, #888);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: all 0.25s ease;
}

.topbar-link:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
}

.topbar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.link-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.topbar-link.active .link-icon {
    opacity: 1;
}

/* ==================== MOBILE SIDEBAR ==================== */
.sidebar {
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 2px 0 40px rgba(0,0,0,0.5);
    position: fixed;
    height: 100vh;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open {
    transform: translateX(0);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: #555;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.nav-link:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(3px);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.nav-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

/* ==================== HAMBURGER ==================== */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    background: rgba(10,10,10,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.hamburger-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 54;
}

.sidebar-overlay.active {
    display: block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .topbar-desktop {
        display: none !important;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .main-content {
        padding: 80px 16px 24px !important;
    }

    .stats-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .stat-divider {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .sidebar {
        display: none !important;
    }

    .hamburger-btn {
        display: none !important;
    }
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 88px 32px 32px;
    position: relative;
    z-index: 1;
}

/* ==================== STATS ROW ==================== */
.stats-row {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    gap: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    padding: 0 16px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.icon-img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.stat-desc {
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-trend {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.stat-trend.up {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.stat-trend.down {
    color: #888;
    background: rgba(255,255,255,0.04);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

/* ==================== CREDIT SECTION ==================== */
.credit-section {
    background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
}

.credit-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.credit-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #fff, #888);
    transition: width 0.8s ease;
}

/* ==================== CHART CARD ==================== */
.chart-card {
    background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02), rgba(255,255,255,0.08));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.live-badge {
    font-size: 10px;
    color: #fff;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== SIDE PANEL ==================== */
.side-panel {
    background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

/* ==================== ACTIVITY LIST ==================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-list::-webkit-scrollbar {
    width: 3px;
}

.activity-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

.activity-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.activity-text {
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
}

.activity-time {
    font-size: 11px;
    color: #444;
}

/* ==================== INFO CARDS ==================== */
.info-card {
    background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 150px;        /* Max 3 item */
    overflow-y: auto;         /* Scroll kalo lebih */
    padding-right: 4px;
}

.endpoint-list::-webkit-scrollbar {
    width: 3px;
}

.endpoint-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
.endpoint-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    transition: all 0.2s ease;
}

.endpoint-item:hover {
    background: rgba(255,255,255,0.04);
}

.endpoint-method {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    flex-shrink: 0;
}

.endpoint-method.post {
    background: rgba(255,255,255,0.12);
}

.endpoint-path {
    font-size: 13px;
    color: #aaa;
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
}

.endpoint-count {
    font-size: 12px;
    color: #555;
    font-weight: 600;
    flex-shrink: 0;
}

/* ==================== HEALTH GRID ==================== */
.health-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.health-label {
    font-size: 12px;
    color: #555;
    width: 60px;
    flex-shrink: 0;
}

.health-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 99px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #fff, #888);
    transition: width 0.8s ease;
}

.health-value {
    font-size: 12px;
    color: #aaa;
    font-weight: 600;
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* ==================== STATUS DOT ==================== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* ==================== RESPONSIVE NAVIGATION ==================== */

/* HAMBURGER BUTTON (Mobile) */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.hamburger-btn span {
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* TOPBAR (Desktop) */
.topbar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-size: 24px;
    font-weight: 800;
}

.brand-text {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 2px;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-link {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.topbar-link:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
}

.topbar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* SIDEBAR (Mobile) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 55;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.close-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    font-size: 28px;
    font-weight: 800;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-link {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: all 0.25s ease;
    display: block;
}

.sidebar-link:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.sidebar-footer {
    font-size: 11px;
    color: #444;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

/* OVERLAY (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 54;
}

.sidebar-overlay.active {
    display: block;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

@media (max-width: 768px) {
    /* HIDE TOPBAR */
    .topbar-desktop {
        display: none !important;
    }

    /* SHOW HAMBURGER */
    .hamburger-btn {
        display: flex !important;
    }

    /* ADJUST MAIN CONTENT */
    .main-content {
        padding: 80px 16px 24px 16px !important;
    }

    .close-btn {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    /* HIDE SIDEBAR & HAMBURGER */
    .sidebar {
        display: none !important;
    }

    .hamburger-btn {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    /* ADJUST MAIN CONTENT FOR TOPBAR */
    .main-content {
        padding-top: 88px !important;
    }
}
