/* =========================================================
   ORION STAKING - SILVER COSMIC THEME
   ========================================================= */

:root {
    --bg-body: #02050d;
    --bg-card: rgba(10, 16, 30, 0.75);
    --bg-widget: rgba(0, 0, 0, 0.4);
    --bg-input: rgba(0, 0, 0, 0.5);
    
    --primary: #c0c0c0; /* Silver */
    --primary-glow: rgba(192, 192, 192, 0.4);
    --success: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-subtle: rgba(192, 192, 192, 0.15);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(226, 232, 240, 0.2), transparent),
        radial-gradient(1px 1px at 30% 40%, rgba(192, 192, 192, 0.2), transparent),
        radial-gradient(1.5px 1.5px at 50% 10%, rgba(255, 255, 255, 0.2), transparent);
    background-size: 150px 150px;
    color: var(--text-main);
    margin: 0;
    padding-bottom: 100px; /* Ruang untuk navbar bawah */
}

.hidden { display: none !important; }

.main-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* --- HEADER --- */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.brand {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-actions { display: flex; gap: 10px; }
.btn-small {
    background: rgba(192,192,192,0.1);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-small:hover { border-color: var(--primary); }

/* =========================================
   VIEW 1: POOLS GRID
========================================= */
.pools-header-text { margin-bottom: 24px; text-align: center; }
.pools-header-text h2 { margin: 0 0 8px 0; font-size: 28px; font-weight: 800; color: #fff; }
.pools-header-text p { margin: 0; color: var(--text-muted); font-size: 14px; }

.pools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.pool-card-item {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.pool-card-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px var(--primary-glow);
}

.pci-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.pci-icons { position: relative; width: 56px; height: 40px; }
.pci-icons img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; position: absolute; border: 2px solid #0a101e; }
.pci-icons img:nth-child(1) { left: 0; z-index: 2; }
.pci-icons img:nth-child(2) { left: 24px; z-index: 1; }

.pci-title { font-size: 18px; font-weight: 800; color: #fff; }
.pci-sub { font-size: 12px; color: var(--text-muted); font-family: monospace; }
.pci-apy-badge { background: rgba(16, 185, 129, 0.1); color: var(--success); padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 1px solid rgba(16, 185, 129, 0.3); }

.pci-stats { display: flex; justify-content: space-between; background: var(--bg-input); padding: 12px; border-radius: var(--radius-md); }
.pci-stat-col { display: flex; flex-direction: column; }
.pci-stat-lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.pci-stat-val { font-size: 14px; font-weight: 600; color: #fff; }

/* =========================================
   VIEW 2: STAKING WIDGET
========================================= */
.btn-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    transition: 0.2s;
    padding: 0;
}
.btn-back:hover { color: #fff; transform: translateX(-5px); }

.widget-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    margin-bottom: 20px;
}

/* Static Pool Banner inside Widget */
.pool-banner-static {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}
.pool-info-left { display: flex; align-items: center; gap: 16px; }
.pool-icons { position: relative; width: 56px; height: 40px; }
.pool-icons img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; position: absolute; border: 2px solid var(--bg-input); }
.pool-icons img:nth-child(1) { left: 0; z-index: 2; }
.pool-icons img:nth-child(2) { left: 24px; z-index: 1; }
.pool-text-main { font-weight: 800; font-size: 18px; color: #fff; }
.pool-text-sub { font-size: 12px; color: var(--text-muted); font-family: monospace; }

/* Metrics */
.metrics-row { display: flex; justify-content: space-between; margin-bottom: 24px; padding: 0 10px; }
.metric-item { text-align: center; }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-size: 18px; font-weight: 800; color: #fff; }

/* Tabs */
.tabs { display: flex; background: var(--bg-input); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tab-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.tab-btn.active { background: var(--bg-card); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Input */
.input-area { background: var(--bg-input); border-radius: var(--radius-md); padding: 20px; border: 1px solid transparent; transition: 0.2s; margin-bottom: 24px; }
.input-area:focus-within { border-color: var(--primary); }
.input-header { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.clickable-balance { color: var(--primary); cursor: pointer; font-weight: 600; transition: 0.2s; }
.clickable-balance:hover { color: #fff; }
.input-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.input-row input { background: transparent; border: none; font-size: 32px; font-weight: 700; color: #fff; width: 100%; outline: none; padding: 0; }
.token-badge { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 6px 14px 6px 8px; border-radius: 20px; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; }
.token-badge img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* Buttons */
.btn-main { width: 100%; padding: 18px; border-radius: var(--radius-md); border: none; font-size: 18px; font-weight: 800; cursor: pointer; transition: 0.2s; color: #000; background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%); text-transform: uppercase; }
.btn-main:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(192,192,192,0.3); }
.btn-main:disabled { background: rgba(192,192,192,0.1); color: var(--text-muted); cursor: not-allowed; }

/* Cards Bawah */
.reward-card, .info-card { background: var(--bg-card); backdrop-filter: blur(8px); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.reward-card { display: flex; justify-content: space-between; align-items: center; }
.reward-info .label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.reward-info .value { font-size: 24px; font-weight: 800; color: var(--warn); }
.reward-info .value span { font-size: 14px; color: var(--text-muted); }
.btn-claim { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--warn); padding: 10px 24px; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-claim:hover { background: var(--warn); color: #000; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }

.info-header { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.btn-small-refresh { margin-left: auto; background: var(--bg-input); border: 1px solid var(--border-subtle); color: #fff; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.btn-small-refresh:hover { color: var(--primary); border-color: var(--primary); }
.holder-list { max-height: 200px; overflow-y: auto; padding-right: 4px; }

/* Admin Area */
.admin-zone { border: 1px solid rgba(239, 68, 68, 0.3); background: rgba(20, 10, 15, 0.8); }
.admin-tag { display: inline-block; background: var(--danger); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 800; margin-bottom: 16px; letter-spacing: 1px; }
.admin-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.admin-input { background: var(--bg-input); border: 1px solid var(--border-subtle); color: #fff; padding: 12px; border-radius: var(--radius-sm); width: 100%; box-sizing: border-box; outline: none; transition: 0.2s; }
.admin-input:focus { border-color: var(--danger); }
.btn-small-admin { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ff8f8f; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-small-admin:hover { background: var(--danger); color: #fff; }

/* Modals System */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
.popup { background: var(--bg-card); border: 1px solid var(--border-subtle); width: 90%; max-width: 400px; border-radius: var(--radius-lg); padding: 30px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.popup h3 { margin: 0 0 10px 0; color: #fff; font-size: 20px; }
.popup p { margin: 0 0 24px 0; color: var(--text-muted); font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Loading Spinner Modal - FIXED PRESISI */
.spinner {
    display: inline-block;
    box-sizing: border-box;
    width: 32px; 
    height: 32px; 
    border: 3px solid rgba(255, 255, 255, 0.1); 
    border-top: 3px solid var(--primary); /* Ketebalan sama persis */
    border-radius: 50%; 
    animation: spin 1s linear infinite;
    margin: 0 auto; /* Tetap berada di tengah */
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}