/* =========================================================
   ORION STAKING FACTORY - SILVER COSMIC THEME
   ========================================================= */

/* --- 1. FONTS & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root { 
  /* Silver & Space Color Palette */
  --bg-body: #02050d;         
  --bg-card: rgba(10, 16, 30, 0.85); /* Solid & ringan di GPU */
  --bg-input: rgba(0, 0, 0, 0.5);    
  --bg-hover: rgba(192, 192, 192, 0.1);
  
  --primary: #c0c0c0;         
  --primary-glow: rgba(192, 192, 192, 0.4);
  
  --text-main: #e2e8f0;       
  --text-sub: #94a3b8;        
  --border-subtle: rgba(192, 192, 192, 0.15); 
  
  --danger: #ef4444;
  --success: #10b981;
  --warn: #f59e0b;
  
  /* Dimensions */
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  /* Effects */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* --- 2. GLOBAL RESET & BACKGROUND --- */
* { box-sizing: border-box; }

body { 
  margin: 0; 
  background-color: var(--bg-body);
  /* Bintang Statis di Background langsung */
  background-image: 
      radial-gradient(1px 1px at 10% 20%, rgba(226, 232, 240, 0.4), transparent),
      radial-gradient(1px 1px at 30% 40%, rgba(192, 192, 192, 0.4), transparent),
      radial-gradient(1.5px 1.5px at 50% 10%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 70% 60%, rgba(148, 163, 184, 0.4), transparent),
      radial-gradient(1.5px 1.5px at 90% 80%, rgba(255, 255, 255, 0.4), transparent);
  background-size: 150px 150px;
  background-attachment: fixed; /* Latar tetap diam saat di-scroll */
  color: var(--text-main); 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
  font-size: 14px; 
  min-height: 100vh;
  padding-bottom: 100px; /* Ruang untuk navbar bawah */
  overflow-x: hidden;
}

/* Layer Bintang Berkelap-kelip */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
      radial-gradient(2px 2px at 15% 70%, #ffffff, transparent),
      radial-gradient(1.5px 1.5px at 45% 85%, #cbd5e1, transparent),
      radial-gradient(2px 2px at 65% 25%, #e2e8f0, transparent),
      radial-gradient(1px 1px at 85% 55%, #c0c0c0, transparent);
  background-size: 250px 250px;
  animation: twinkleLight 4s infinite alternate;
  will-change: opacity;
}

@keyframes twinkleLight {
  0% { opacity: 0.1; }
  100% { opacity: 0.7; }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,192,192,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.container { max-width: 680px; margin: 0 auto; padding: 20px; }

/* --- 3. HEADER & NAVIGATION --- */
.nav-header { 
  display: flex; justify-content: space-between; align-items: center; 
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand { 
  display: flex; align-items: center; gap: 8px; 
  font-size: 20px; font-weight: 800; color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.2); 
}
.brand svg { color: var(--primary); }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Tombol Kecil (Lang/Connect) */
.btn-small, .btn-connect { 
  background: rgba(192, 192, 192, 0.05); 
  border: 1px solid var(--border-subtle); 
  color: var(--text-main);
  padding: 8px 16px; border-radius: 20px; 
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  display: flex; align-items: center; gap: 6px;
}
.btn-small:hover, .btn-connect:hover { 
  background: rgba(192, 192, 192, 0.15); 
  border-color: var(--primary); 
}

/* --- 4. CARDS (GLASSMORPHISM) --- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card-header { 
  display: flex; align-items: center; gap: 12px; 
  margin-bottom: 20px; padding-bottom: 16px; 
  border-bottom: 1px solid rgba(255,255,255,0.05); 
}
.card-header h3 { 
  margin: 0; font-size: 16px; font-weight: 700; color: #fff; 
}
.card-icon { 
  background: rgba(192, 192, 192, 0.1); 
  padding: 8px; border-radius: 12px; color: var(--primary); 
  display: flex; border: 1px solid var(--border-subtle);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hidden { display: none !important; }

/* --- 5. FORMS & INPUTS --- */
.form-group { margin-bottom: 16px; }
.label { 
  display: block; color: var(--text-sub); 
  font-size: 12px; margin-bottom: 8px; font-weight: 600; 
  letter-spacing: 0.5px; text-transform: uppercase;
}
.sub-label { 
  display: block; color: var(--text-sub); font-size: 11px; 
  margin-top: 6px; line-height: 1.4; 
}

input, select { 
  width: 100%; background: var(--bg-input); 
  border: 1px solid var(--border-subtle); 
  color: #fff; padding: 14px 16px; 
  border-radius: var(--radius-md); 
  box-sizing: border-box; 
  font-size: 14px; transition: all 0.2s ease; 
  font-family: 'Inter', sans-serif;
  outline: none;
}
input:hover, select:hover { border-color: rgba(192,192,192,0.3); }
input:focus, select:focus { 
  border-color: var(--primary); 
  background: rgba(0, 0, 0, 0.7); 
}
input::placeholder { color: rgba(255,255,255,0.2); }

/* Input with Search Button */
.input-with-btn { display: flex; position: relative; }
.input-with-btn input { padding-right: 54px; }
.btn-icon { 
  position: absolute; right: 6px; top: 6px; bottom: 6px; 
  background: rgba(192,192,192,0.1); 
  color: var(--text-main); border: 1px solid transparent; 
  width: 40px; border-radius: 10px; 
  cursor: pointer; transition: all 0.2s; 
  display: flex; align-items: center; justify-content: center; 
}
.btn-icon:hover { 
  background: rgba(192,192,192,0.2); 
  border-color: var(--primary); 
  color: #fff;
}
.btn-icon svg { width: 18px; height: 18px; }

/* --- 6. RADIO GROUPS (SERAGAM DENGAN TABS) --- */
.radio-group { 
  display: flex; gap: 8px; background: var(--bg-input); 
  padding: 4px; border-radius: var(--radius-md); 
  border: 1px solid transparent; transition: 0.2s;
}
.radio-group:hover { border-color: rgba(192,192,192,0.2); }

.radio-label { 
  flex: 1; text-align: center; padding: 10px; border-radius: 10px; 
  cursor: pointer; transition: all 0.2s ease; 
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  display: flex; align-items: center; justify-content: center; gap: 6px; 
}
.radio-label:hover { color: #fff; }
input[type="radio"] { display: none; }
input[type="radio"]:checked + .radio-label { 
  background: var(--bg-card); color: #fff; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
  border: 1px solid var(--border-subtle); 
}

/* --- 7. BUTTONS (SILVER METALLIC) --- */
.btn-deploy { 
  width: 100%; padding: 18px; border: none; 
  border-radius: var(--radius-md); font-weight: 800; 
  cursor: pointer; transition: all 0.2s ease; color: #000; font-size: 16px; 
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%); 
  box-shadow: 0 4px 15px rgba(192, 192, 192, 0.2); 
  display: flex; align-items: center; justify-content: center; gap: 10px; 
  margin-top: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-deploy:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(192, 192, 192, 0.4); 
  filter: brightness(1.1); 
}
.btn-deploy:active { transform: translateY(1px); }

/* --- 8. INFO BOXES --- */
.fee-info, .advanced-note, .orion-fee { 
  padding: 14px 16px; border-radius: var(--radius-md); font-size: 13px; 
  margin-top: 16px; display: flex; align-items: flex-start; gap: 12px; 
  line-height: 1.5; font-weight: 500; border: 1px solid transparent;
}
.fee-info { 
  background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); color: #fca5a5; 
}
.advanced-note { 
  background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.2); color: #bae6fd; 
}
.orion-fee {
  background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); color: #fcd34d;
}
.fee-info svg, .advanced-note svg, .orion-fee svg { flex-shrink: 0; margin-top: 2px; }

/* --- 9. TERMINAL --- */
.terminal-wrapper { 
  background: rgba(0,0,0,0.6); border: 1px solid var(--border-subtle); 
  border-radius: var(--radius-md); position: relative; 
  overflow: hidden; backdrop-filter: blur(4px);
}
.terminal-header { 
  background: rgba(0,0,0,0.4); padding: 10px 16px; 
  display: flex; align-items: center; 
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px; 
  color: var(--text-sub); border-bottom: 1px solid rgba(255,255,255,0.05); 
}
.terminal-header div { display: flex; gap: 6px; margin-right: 12px; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.r { background: #ef4444; } 
.terminal-dot.y { background: #f59e0b; } 
.terminal-dot.g { background: #10b981; }

pre { 
  margin: 0; padding: 16px; height: 140px; overflow-y: auto; 
  font-size: 12px; color: var(--success); white-space: pre-wrap; 
  word-break: break-all; font-family: 'JetBrains Mono', monospace; 
  line-height: 1.6; 
}

/* --- 10. MODALS (Z-INDEX 2000 & SILVER) --- */
.modal-overlay { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(2, 5, 13, 0.85); display: none; 
  align-items: center; justify-content: center; z-index: 2000; 
}
.modal-overlay.active { display: flex; animation: modalPop 0.2s ease-out; }

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.popup { 
  background: var(--bg-card); 
  border: 1px solid var(--border-subtle); 
  width: 90%; max-width: 420px; padding: 24px; border-radius: var(--radius-xl); 
  text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.9);
  display: flex; flex-direction: column; max-height: 85vh;
}

.popup h3 { margin: 0 0 16px 0; font-size: 18px; font-weight: 700; color: #fff; }
.popup p { color: var(--text-sub); font-size: 14px; margin: 0 0 24px 0; line-height: 1.6; }

.btn-close { 
  background: var(--bg-input); border: 1px solid var(--border-subtle); 
  color: var(--text-main); padding: 14px; border-radius: var(--radius-md); 
  font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; 
}
.btn-close:hover { background: rgba(192,192,192,0.1); color: #fff; }

/* --- 11. TOKEN LIST --- */
#token-list-container { 
  overflow-y: auto; flex: 1; margin: 16px 0; padding-right: 6px; 
}
.token-item { 
  display: flex; align-items: center; padding: 12px; 
  border-radius: var(--radius-md); cursor: pointer; gap: 14px; 
  border-bottom: 1px solid rgba(255,255,255,0.02); transition: all 0.2s ease; margin-bottom: 4px; 
}
.token-item:hover { 
  background: rgba(192,192,192,0.05); 
}
.token-logo { 
  width: 36px; height: 36px; border-radius: 50%; 
  object-fit: cover; 
}
.token-info { flex: 1; text-align: left; }
.token-symbol { font-weight: 700; color: #fff; font-size: 15px; }
.token-name { font-size: 12px; color: var(--text-sub); margin-top: 2px;}
.token-addr { 
  font-family: monospace; font-size: 11px; 
  color: var(--text-sub); background: var(--bg-input); 
  padding: 4px 8px; border-radius: 6px; 
  border: 1px solid var(--border-subtle); 
}

/* Spinner */
.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); 
  border-radius: 50%; margin: 20px auto; 
  animation: spin 1s linear infinite; 
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Responsive adjustments */
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 20px; }
}