/* =========================================
   1. VARIABEL & SECURITY RESET
   ========================================= */
:root {
    --primary: #3b82f6;
    --primary-light: #eff6ff;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(37, 99, 235, 0.08);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #eef5ff;
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: 4rem;
}

.bg-orb-1 {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(147,197,253,0.6) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    border-radius: 50%;
}

.bg-orb-2 {
    position: absolute;
    top: 20%;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(191,219,254,0.5) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    border-radius: 50%;
}

.container {
    max-width: 550px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* =========================================
   2. HEADER GLASSMORPHISM
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 20px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

.logo-icon {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.status-live {
    background: white;
    color: #10b981;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.status-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =========================================
   3. HERO TEXT
   ========================================= */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0 1rem;
}

/* =========================================
   4. STATS CARDS (KEMBALI KE DESAIN AWAL)
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    opacity: 0.7;
}

.stat-card.full { grid-column: span 2; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0.5rem 0 0.2rem 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   5. SEARCH & CATEGORY PILLS
   ========================================= */
.search-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    border: 2px solid white;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--glass-shadow);
    font-size: 1rem;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s;
}

.search-container input:focus {
    border-color: #93c5fd;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.4rem; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.category-filters {
    display: flex; gap: 12px;
    overflow-x: auto; padding-bottom: 10px;
    margin-bottom: 2rem; scrollbar-width: none;
}

.category-filters::-webkit-scrollbar { display: none; }

.filter-btn {
    background: white; border: 1px solid var(--glass-border);
    padding: 10px 20px; border-radius: 50px; font-size: 0.9rem;
    color: var(--text-muted); cursor: pointer; white-space: nowrap;
    transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    font-weight: 500;
}

.filter-btn.active {
    background: var(--primary); color: white;
    box-shadow: 0 6px 15px var(--primary-glow);
    border-color: var(--primary); font-weight: 600;
}

/* =========================================
   6. ENDPOINT LIST
   ========================================= */
.section-title {
    font-size: 1.2rem; font-weight: 700;
    margin-bottom: 1rem; display: flex;
    align-items: center; gap: 10px;
}

.endpoint-list { display: flex; flex-direction: column; gap: 1.2rem; }

.endpoint-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px; padding: 1.2rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--glass-shadow); border: 1px solid var(--glass-border);
    transition: all 0.3s ease; cursor: pointer;
}

.endpoint-card:hover {
    transform: translateY(-3px) scale(1.01);
    background: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.1);
}

.endpoint-info { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.endpoint-top { display: flex; align-items: center; gap: 12px; }

.method-get {
    background: #e0f2fe; color: #0284c7;
    padding: 6px 12px; border-radius: 10px;
    font-size: 0.75rem; font-weight: 800;
}

.endpoint-title { font-weight: 700; font-size: 1.1rem; color: var(--text-dark); }
.endpoint-desc { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.btn-arrow {
    width: 40px; height: 40px; border-radius: 50%;
    background: white; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #e2e8f0; font-size: 1.5rem; flex-shrink: 0;
    transition: all 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.endpoint-card:hover .btn-arrow {
    background: var(--primary); color: white;
    border-color: var(--primary); box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateX(3px);
}

/* =========================================
   7. MODAL POP-UP SYSTEM (PAS DI TENGAH & FIT CARD)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; 
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    opacity: 0; pointer-events: none;
    transition: all 0.25s ease;
    padding: 1.2rem;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 24px; 
    padding: 1.5rem;
    width: 100%;
    max-width: 502px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    transform: scale(0.9); 
    transition: all 0.25s ease;
    box-sizing: border-box;
    max-height: 85vh; 
    overflow-y: auto;
}

.modal-overlay.active .modal-content { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1.15rem; font-weight: 800; color: var(--text-dark); }
.modal-close { background: none; border: none; font-size: 1.6rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: #ef4444; }

.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.input-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.endpoint-preview-box {
    background: #f1f5f9; color: #1e293b;
    padding: 12px; border-radius: 12px; font-family: monospace;
    font-size: 0.78rem; word-break: break-all; overflow-wrap: break-word;
    border: 1px solid #cbd5e1; font-weight: 500; width: 100%; box-sizing: border-box;
}

.modal-input {
    width: 100%; padding: 12px; border-radius: 12px;
    border: 1px solid #cbd5e1; background: #ffffff;
    outline: none; font-size: 0.88rem; box-sizing: border-box;
}
.modal-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.btn-send {
    width: 100%; padding: 12px; border: none; border-radius: 12px;
    background: var(--primary); color: white; font-weight: 600;
    font-size: 0.9rem; cursor: pointer; box-shadow: 0 4px 12px var(--primary-glow);
    margin-bottom: 0.25rem; box-sizing: border-box;
}
.btn-send:hover { background: #2563eb; }
.btn-send:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; }

.response-container { margin-top: 1.25rem; display: none; flex-direction: column; gap: 6px; }
.response-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.response-box {
    background: #0f172a; color: #38bdf8;
    padding: 1rem; border-radius: 14px; font-family: monospace;
    font-size: 0.78rem; max-height: 160px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;
    width: 100%; display: block; box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.05);
}

.response-box::-webkit-scrollbar { width: 4px; }
.response-box::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
