:root {
    /* Base Colors */
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Glass Effect */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    /* Brand Colors */
    --primary: #3b82f6;  /* Blue */
    --secondary: #8b5cf6; /* Purple */
    --accent: #06b6d4;    /* Cyan */
    
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.5);
    
    --font-sans: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Modern Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: #334155; 
    border-radius: 10px; 
    border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover { background: #475569; }

.main-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    flex: 1;
    z-index: 1;
}

/* --- Header --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 1rem;
    z-index: 50;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.api-key-container {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
    transition: 0.3s;
}

.api-key-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.key-input {
    background: transparent;
    border: none;
    padding: 6px 12px;
    color: var(--text-primary);
    width: 120px;
    outline: none;
    font-size: 0.9rem;
}

.key-btn {
    background: var(--primary);
    border: none;
    color: white;
    width: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover { opacity: 0.9; }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.stat-card:hover::before { transform: translateX(100%); }

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.stat-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap; /* Ditambahkan: agar teks tidak pindah baris */
    overflow: hidden; /* Ditambahkan: menyembunyikan teks yang berlebih */
    text-overflow: ellipsis; /* Ditambahkan: menampilkan ... jika teks terpotong */
}

.value.online {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.value.online::before {
    content: '';
    display: block;
    width: 8px; height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

/* --- Bento Grid / Lists --- */
.category-header {
    grid-column: span 4;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
}

.list-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.list-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.list-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.9);
}

.list-card .list-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    /* Warna background diambil dari inline style HTML, kita tidak override paksa */
}

.list-info { flex: 1; overflow: hidden; }

.list-info h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-action {
    color: var(--text-secondary);
    transition: 0.3s;
}

.list-card:hover .list-action {
    color: var(--primary);
    transform: translateX(3px);
}

.method-badge {
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.method-badge.mt {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    display: flex;
}

.modal-content {
    background: #1e293b;
    width: 100%;
    max-width: 550px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 32px; height: 32px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.modal-body { padding: 1.5rem; }

.input-wrapper { margin-bottom: 1.5rem; }

.input-wrapper label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.input-wrapper input {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.url-preview-box {
    background: #0f172a;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-value {
    color: #64748b;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.copy-url-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 4px;
}

.execute-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.execute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.response-box {
    background: #0f172a;
    border: 1px solid var(--glass-border);
    margin-top: 1.5rem;
    border-radius: 12px;
    min-height: 250px; /* Ditambahkan */
    max-height: 400px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.response-box pre {
    padding: 1rem;
    margin: 0;
    color: #a5b4fc;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow: auto;
    white-space: pre-wrap;
}

.copy-json-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border: none;
    font-size: 0.75rem;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.copy-json-btn:hover { background: rgba(255,255,255,0.2); color: white; }

/* Footer */
.simple-footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    width: 100%;
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .main-wrapper { padding: 1rem; }
    .top-nav { border-radius: 0; margin: -1rem -1rem 2rem -1rem; border-left: 0; border-right: 0; border-top: 0; }
    .list-group { grid-template-columns: 1fr; }
}
