/* 
   Web-Dapp-Protocol Design System + Premium Component Library
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #00DBBC;
  --primary-glow: rgba(0, 219, 188, 0.3);
  --bg: #0e0e0e;
  --surface: #161616;
  --surface-light: #1e1e1e;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Splash Screen */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.splash.hidden { opacity: 0; visibility: hidden; }
.splash-content { text-align: center; width: 90%; max-width: 400px; }
.splash-logo { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 40px; letter-spacing: -0.04em; }
.splash-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.splash-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.splash-progress-container { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; overflow: hidden; position: relative; }
.splash-progress-bar { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: var(--primary); box-shadow: 0 0 15px var(--primary-glow); transition: width 0.3s ease; }
.splash-status { margin-top: 16px; font-size: 12px; color: var(--primary); font-family: monospace; text-transform: uppercase; }

/* Ticker */
.ticker-wrap { width: 100%; height: 40px; background: #000; border-bottom: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; position: relative; z-index: 1001; }
.ticker { display: flex; white-space: nowrap; animation: ticker 40s linear infinite; }
.ticker-item { padding: 0 30px; font-size: 11px; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.ticker-item span { color: var(--primary); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Header & Nav */
.header, .wallet-header-bar { height: 80px; background: rgba(14, 14, 14, 0.85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; }
.header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: #fff; text-decoration: none; flex-shrink: 0; }
.logo-icon { width: 34px; height: 34px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #000; }
.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* Global Buttons */
.btn-validate { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #fff; color: #fff; padding: 10px 24px; border-radius: 50px; text-decoration: none; font-size: 14px; font-weight: 600; transition: var(--transition); background: transparent; cursor: pointer; border: 1px solid rgba(255,255,255,0.2) !important; }
.btn-validate:hover { background: #fff !important; color: #000 !important; }

/* Search UI */
.search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 6px;
  transition: var(--transition);
  margin-right: 8px;
}
.search-container:focus-within { border-color: var(--primary); background: rgba(255, 255, 255, 0.08); }
.search-input {
  background: none;
  border: none;
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  width: 140px;
  transition: width 0.3s ease;
}
.search-input:focus { width: 220px; }
.search-trigger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  padding: 6px;
  align-items: center; justify-content: center;
}
.search-trigger:hover { color: var(--primary); }

.icon-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 8px; }

/* Modals & Overlays */
#export-report.btn-validate { background: #fff !important; color: #000 !important; border-color: #fff !important; }
#export-report.btn-validate:hover { background: var(--primary) !important; border-color: var(--primary) !important; }

.modal-overlay, .connecting-overlay, .import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px; /* Generous vertical padding */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active, .connecting-overlay.active, .import-overlay.active { display: flex; }

.error-modal, .connecting-box, .import-modal {
  background: #161616 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 24px;
  padding: 40px 32px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  position: relative;
  margin-bottom: 60px; /* Space at the bottom when scrolling */
  flex-shrink: 0; /* Important for flex-column scrolling */
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close-x { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.05) !important; border: none !important; color: #fff !important; width: 32px; height: 32px; border-radius: 50% !important; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.modal-close-x:hover { background: rgba(255,255,255,0.1) !important; }

/* Import Modal Specifics */
.import-modal-header { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 30px; }
.import-brand-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 6px; object-fit: contain; }
.import-modal-title { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }

.import-tabs-container { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.import-tab { flex: 1; background: transparent !important; border: none !important; color: var(--text-muted) !important; font-weight: 700 !important; cursor: pointer !important; padding: 12px 6px; font-size: 13px !important; transition: 0.3s; position: relative; text-align: center; }
.import-tab.active { color: var(--primary) !important; }
.import-tab.active::after { content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 2px; }

.import-textarea, .import-input { width: 100%; background: #000 !important; border: 1px solid var(--border) !important; border-radius: 16px !important; padding: 18px !important; color: #fff !important; font-family: inherit; font-size: 15px; margin-bottom: 12px; outline: none; transition: 0.3s; }
.import-textarea { min-height: 120px; resize: none; line-height: 1.5; }
.import-textarea:focus, .import-input:focus { border-color: var(--primary) !important; }

.import-hint { text-align: left; font-size: 12px; color: var(--text-muted); margin-bottom: 20px; padding-left: 4px; }
.import-data-disclaimer { text-align: left; font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 20px 0 30px; display: flex; gap: 10px; }
.import-data-disclaimer svg { flex-shrink: 0; color: var(--primary); margin-top: 2px; }

.btn-connect, .btn-connect-manually {
  background: var(--primary) !important;
  color: #000 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px var(--primary-glow) !important;
  border-radius: 16px !important;
  padding: 18px !important;
  width: 100% !important;
  border: none !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  font-size: 15px !important;
  text-decoration: none !important;
  display: block !important;
  text-align: center !important;
}
.btn-connect:hover, .btn-connect-manually:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px var(--primary-glow) !important;
}

/* Hero, Ticker & Rest */
.hero { padding: 120px 24px 80px; text-align: center; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; line-height: 1.1; margin-bottom: 24px; }
.services { padding: 60px 24px; background: #000; }
.services-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; margin: 0 auto; }
.service-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: #fff; padding: 12px 28px; border-radius: 50px; text-decoration: none; font-size: 14px; font-weight: 600; transition: var(--transition); display: flex; align-items: center; gap: 10px; }
.service-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); transform: translateY(-3px); }

.wallet-section-title { text-align: center; font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin: 60px 0 40px; color: #fff; }

.features { padding: 100px 24px; background: #0e0e0e; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }

.feature-card {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.05);
  padding: 32px;
  border-radius: 12px;
  text-align: left;
  transition: all 0.3s ease;
}
.feature-card:hover { border-color: var(--primary); background: #1a1a1a; }

.feature-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(0, 219, 188, 0.08); /* Greenish tint */
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 24px;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.wallets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto; padding-bottom: 80px; }
.wallet-card { background: var(--surface); border: 1px solid var(--border); padding: 20px; border-radius: 18px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: var(--transition); }
.wallet-card:hover { border-color: var(--primary); transform: translateY(-4px); }
.wallet-icon { width: 44px; height: 44px; border-radius: 10px; background: #fff; padding: 4px; overflow: hidden; }
.wallet-icon img { width: 100%; height: 100%; object-fit: contain; }

.footer { padding: 80px 24px; border-top: 1px solid var(--border); background: #000 !important; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-logo { font-size: 24px; font-weight: 800; color: #fff; }
.subscribe-form { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.subscribe-form input { background: none; border: none; padding: 14px; color: #fff; outline: none; width: 220px; }
.subscribe-btn { background: var(--primary); border: none; padding: 14px 20px; cursor: pointer; color: #000; font-weight: 700; }

.error-wallet-icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 16px; display: block; background: #fff; object-fit: contain; padding: 8px; }
.error-wallet-name { font-weight: 700; font-size: 16px; margin-bottom: 24px; color: var(--text-muted); }
.error-session-title { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.error-message-box { border: 1px solid rgba(255, 68, 68, 0.2); background: rgba(255, 68, 68, 0.05); color: #ff6b6b; padding: 16px; border-radius: 16px; font-size: 14px; margin-bottom: 30px; }

.modal-btn-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.btn-try-again { width: 100%; padding: 16px; border-radius: 16px; font-weight: 700; background: transparent; color: #fff; border: 1px solid var(--border); cursor: pointer; }
.btn-try-again:hover { background: rgba(255,255,255,0.05); }

.encryption-tag, .import-data-disclaimer { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.encryption-tag svg, .import-data-disclaimer svg { color: var(--primary); }

.connect-result { color: #ff6b6b; font-size: 13px; font-weight: 700; margin-top: 16px; display: none; }
.connect-result.active { display: block; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); padding: 0 24px; gap: 24px; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; height: auto; padding: 12px 16px; }
  .logo span { font-size: 16px; white-space: nowrap; }
  .logo-icon { width: 32px; height: 32px; }
  
  .header-right { gap: 10px; width: 100%; justify-content: space-between; margin-top: 10px; }
  
  .search-container { flex: 1; min-width: 120px; }
  .search-input { width: 100%; font-size: 13px; padding: 6px 10px; }
  .search-input:focus { width: 100%; }
  
  .btn-validate { padding: 8px 14px; font-size: 13px; height: 38px; white-space: nowrap; flex-shrink: 0; display: inline-flex; overflow: visible; }
  .btn-validate svg { width: 14px; height: 14px; flex-shrink: 0; }
  
  .hero { padding: 80px 20px 60px; }
  .hero-title { font-size: clamp(28px, 8vw, 36px); }
  .hero-subtitle { font-size: 15px; margin-bottom: 30px; line-height: 1.5; }
  
  .features { padding: 60px 20px; }
  .features-grid { grid-template-columns: 1fr; gap: 20px; }
  .feature-card { padding: 32px 24px; }
  .feature-card p { word-break: break-word; }
  
  .wallets-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 40px 16px; gap: 12px; }
  .wallet-card { padding: 16px; gap: 12px; }
  .wallet-icon { width: 36px; height: 36px; }
  .wallet-name { font-size: 14px; }
  
  .footer-inner { flex-direction: column; gap: 32px; text-align: center; }
  .footer-left p { margin: 0 auto; max-width: 400px; }
}

@media (max-width: 480px) {
  .header-inner { flex-wrap: nowrap; height: 70px; justify-content: space-between; gap: 8px; padding: 0 12px; }
  
  .logo { flex-shrink: 0; gap: 6px; }
  .logo-icon { width: 28px; height: 28px; }
  .logo span { display: none; } /* Use only icon for home on tiny screens, or very short text */
  
  .search-container { flex: 1; min-width: 40px; margin: 0; padding: 2px 4px; border-radius: 6px; overflow: hidden; }
  .search-input { width: 100%; font-size: 11px; padding: 4px 6px; }
  .search-input:focus { position: static; width: 100%; top: auto; left: auto; right: auto; }
  .search-trigger { padding: 4px; }
  .search-trigger svg { width: 14px; height: 14px; }
  
  .btn-validate { padding: 6px 10px; font-size: 11px; height: 32px; border-radius: 8px; flex-shrink: 0; }
  .btn-validate svg { width: 12px; height: 12px; margin-right: 4px; }
  
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  
  .error-modal, .import-modal { padding: 32px 20px; border-radius: 16px; width: 95%; }
  .error-session-title, .import-modal-title { font-size: 20px; }
  
  .wallets-grid { grid-template-columns: repeat(2, 1fr); padding: 20px 12px; gap: 8px; }
  .wallet-card { padding: 12px; flex-direction: column; text-align: center; gap: 8px; }
  .wallet-icon { margin: 0 auto; width: 32px; height: 32px; }
  .wallet-name { font-size: 12px; line-height: 1.2; word-break: break-word; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 24px; }
  .logo span { font-size: 13px; }
  .wallets-grid { grid-template-columns: 1fr; } /* Stack on ultra-thin screens */
}