/* ============================================
   HASHLEND — Bitcoin-Native Lending on OP_NET
   Dark mode · BTC Orange · Neon Green · Red
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-input: #0d1420;
  --border: #1e293b;
  --border-active: #f7931a;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --btc-orange: #f7931a;
  --btc-orange-dim: #c77a15;
  --btc-orange-glow: rgba(247, 147, 26, 0.3);

  --green: #22c55e;
  --green-dim: #16a34a;
  --green-glow: rgba(34, 197, 94, 0.25);

  --yellow: #eab308;
  --yellow-glow: rgba(234, 179, 8, 0.25);

  --red: #ef4444;
  --red-dim: #dc2626;
  --red-glow: rgba(239, 68, 68, 0.25);

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Custom Background */
.custom-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -3;
  opacity: 0.3;
}

#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.5; /* Reduced from 0.8 to 0.5 for subtlety */
  pointer-events: none;
}

/* Music Controls */
.music-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.music-btn {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.8) 0%, rgba(255, 140, 0, 0.9) 100%);
  border: 1px solid rgba(255, 165, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
  backdrop-filter: blur(10px);
}

.music-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.music-btn:active {
  transform: scale(0.95);
}

#musicIcon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Logo Image */
.logo-img {
  height: 60px; /* Increased from 40px to 60px (50% larger) */
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  position: relative;
}

.logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(255, 165, 0, 0.6));
  box-shadow: 
    0 0 20px rgba(255, 165, 0, 0.4),
    inset 0 0 10px rgba(255, 165, 0, 0.2);
}

.logo-img:active {
  transform: scale(0.95);
  filter: drop-shadow(0 6px 12px rgba(255, 165, 0, 0.8));
  box-shadow: 
    0 0 30px rgba(255, 165, 0, 0.6),
    inset 0 0 15px rgba(255, 165, 0, 0.3);
}

/* Logo glow animation */
@keyframes logoGlow {
  0% {
    box-shadow: 
      0 0 10px rgba(255, 165, 0, 0.3),
      inset 0 0 5px rgba(255, 165, 0, 0.1);
  }
  50% {
    box-shadow: 
      0 0 25px rgba(255, 165, 0, 0.5),
      inset 0 0 12px rgba(255, 165, 0, 0.2);
  }
  100% {
    box-shadow: 
      0 0 10px rgba(255, 165, 0, 0.3),
      inset 0 0 5px rgba(255, 165, 0, 0.1);
  }
}

.logo-img {
  animation: logoGlow 3s ease-in-out infinite alternate;
}

/* Main content wrapper */
.main-wrapper {
  position: relative;
  z-index: 1;
  background: transparent; /* Removed background filter */
  backdrop-filter: none; /* Removed blur */
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px; /* Reduced from 16px to 12px */
}

.header-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem; /* Reduced from 1rem to 0.5rem */
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-center .nav-tabs {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.15) 0%, rgba(255, 140, 0, 0.25) 50%, rgba(255, 165, 0, 0.15) 100%);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 1rem;
  padding: 0.3rem 1rem; /* Reduced from 0.5rem to 0.3rem */
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 20px rgba(255, 165, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: orangeGlow 3s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes orangeGlow {
  0% { 
    box-shadow: 
      0 4px 20px rgba(255, 165, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 165, 0, 0.3);
  }
  100% { 
    box-shadow: 
      0 4px 30px rgba(255, 165, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 165, 0, 0.5);
  }
}

.header-center .nav-tabs .tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.6rem 1.2rem;
  border-radius: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.header-center .nav-tabs .tab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.header-center .nav-tabs .tab-btn:hover::before {
  left: 100%;
}

.header-center .nav-tabs .tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.header-center .nav-tabs .tab-btn.active {
  background: linear-gradient(135deg, var(--btc-orange) 0%, #ffa940 100%);
  color: #000;
  text-shadow: none;
  box-shadow: 
    0 4px 15px rgba(255, 165, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* BTC Price Card in Navigation */
.btc-price-card {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.2) 0%, rgba(255, 140, 0, 0.3) 100%);
  border: 1px solid rgba(255, 165, 0, 0.5);
  border-radius: 0.8rem;
  padding: 0.5rem 0.8rem;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 15px rgba(255, 165, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  min-width: 100px;
  text-align: center;
  transition: all 0.3s ease;
  margin: 0 0.2rem;
}

.btc-price-card:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(255, 165, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btc-price-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.btc-price-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f0; /* Changed to green */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.btc-price-change {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.btc-price-change.positive {
  background: rgba(0, 255, 0, 0.2);
  color: #0f0;
}

.btc-price-change.negative {
  background: rgba(255, 0, 0, 0.2);
  color: #f00;
}

.btc-price-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  font-weight: 600;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px var(--btc-orange-glow));
}

.logo-text {
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.accent {
  color: var(--btc-orange);
}

.tagline {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: none;
}

.btc-price-clock {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.clock-face {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg-card) 0%, var(--bg-dark) 100%);
  border: 3px solid var(--btc-orange);
  position: relative;
  box-shadow: 
    0 0 20px rgba(255, 165, 0, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: clockGlow 3s ease-in-out infinite alternate;
}

@keyframes clockGlow {
  0% { box-shadow: 0 0 20px rgba(255, 165, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5); }
  100% { box-shadow: 0 0 30px rgba(255, 165, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5); }
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--btc-orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.8);
}

.clock-hand {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 2px;
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hour-hand {
  width: 4px;
  height: 35px;
  background: linear-gradient(to top, var(--btc-orange) 0%, #ffa940 100%);
  transform: translate(-50%, -100%) rotate(0deg);
}

.minute-hand {
  width: 3px;
  height: 45px;
  background: linear-gradient(to top, var(--green) 0%, #4ade80 100%);
  transform: translate(-50%, -100%) rotate(0deg);
}

.second-hand {
  width: 2px;
  height: 50px;
  background: linear-gradient(to top, var(--primary) 0%, #60a5fa 100%);
  transform: translate(-50%, -100%) rotate(0deg);
}

.clock-price {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--btc-orange);
  font-family: 'Fira Code', monospace;
  text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.clock-change {
  position: absolute;
  top: 75%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  z-index: 5; /* Ensure change is above hands */
}

.clock-change.positive {
  color: var(--green);
  text-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}

.clock-change.negative {
  color: var(--red);
  text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

.clock-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Clock hour markers */
.clock-face::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: var(--btc-orange);
  transform: translateX(-50%);
  border-radius: 1px;
}

.clock-face::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: var(--btc-orange);
  transform: translateX(-50%);
  border-radius: 1px;
}

@media (min-width: 768px) {
  .tagline { display: block; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Navigation Tabs (standalone) ── */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-connect {
  background: var(--btc-orange);
  color: #000;
  box-shadow: 0 0 20px var(--btc-orange-glow);
}
.btn-connect:hover {
  background: #ffa940;
  box-shadow: 0 0 30px var(--btc-orange-glow);
  transform: translateY(-1px);
}

.btn-disconnect {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn-disconnect:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-deposit {
  background: var(--btc-orange);
  color: #000;
  width: 100%;
}
.btn-deposit:hover {
  background: #ffa940;
  transform: translateY(-1px);
}

.btn-borrow {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dim) 100%);
  color: #000;
  flex: 1;
}
.btn-borrow:hover {
  box-shadow: 0 0 20px var(--green-glow);
  transform: translateY(-1px);
}

.btn-faucet {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}
.btn-faucet:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.btn-repay {
  background: var(--btc-orange);
  color: #000;
  flex: 1;
}
.btn-repay:hover {
  background: #ffa940;
  transform: translateY(-1px);
}

.btn-repay-max {
  background: transparent;
  border: 1px solid var(--btc-orange);
  color: var(--btc-orange);
  flex: 1;
}
.btn-repay-max:hover {
  background: var(--btc-orange);
  color: #000;
}

.btn-close {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  flex: 1;
}
.btn-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-liquidate {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dim) 100%);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 12px;
}
.btn-liquidate:hover {
  box-shadow: 0 0 20px var(--red-glow);
  transform: translateY(-1px);
}

/* ── Wallet Info ── */
.wallet-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-details {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.wallet-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-live {
  background: var(--green);
  color: #000;
}
.badge-demo {
  background: var(--yellow);
  color: #000;
}

.wallet-addr {
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
  color: var(--text-primary);
}

.wallet-bal {
  font-size: 0.8rem;
  color: var(--btc-orange);
  font-weight: 600;
}

.wallet-op20-bal {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 600;
  margin-left: 0.5rem;
}

.faucet-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.8rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
}

.faucet-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-history {
  grid-column: span 2;
}

.card-history .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
}

.history-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}

.history-item.success {
  border-left: 3px solid var(--green);
}

.history-item.pending {
  border-left: 3px solid var(--yellow);
}

.history-item.failed {
  border-left: 3px solid var(--red);
}

.history-info {
  flex: 1;
}

.history-type {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.history-amount {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.history-time {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.history-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  text-transform: uppercase;
}

.history-status.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.history-status.pending {
  background: rgba(250, 204, 21, 0.2);
  color: var(--yellow);
}

.history-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.btn-small {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-small:hover {
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* ── Tab Content ── */
.tab-content {
  display: none;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}
.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Dashboard Tagline ── */
.dashboard-tagline {
  display: inline-block;
  background: linear-gradient(90deg, 
    rgba(255, 165, 0, 0.4) 0%, 
    rgba(255, 140, 0, 0.5) 25%, 
    rgba(255, 165, 0, 0.4) 50%, 
    rgba(255, 120, 0, 0.5) 75%, 
    rgba(255, 165, 0, 0.4) 100%);
  background-size: 200% 100%;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  animation: flowingOrange 3s ease-in-out infinite;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 165, 0, 0.3);
}

@keyframes flowingOrange {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.3);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 6px 25px rgba(255, 140, 0, 0.4);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.3);
  }
}

/* ── Cards ── */
.card {
  background: rgba(17, 24, 39, 0.85); /* Semi-transparent for matrix visibility */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px); /* Add blur for readability */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.card:hover {
  border-color: rgba(247, 147, 26, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-tagline {
  font-size: 0.8rem;
  color: rgba(255, 165, 0, 0.8);
  font-style: italic;
  margin-bottom: 1.5rem;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 165, 0, 0.05);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 165, 0, 0.2);
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ── Dashboard Grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

/* ── Position Stats ── */
.position-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-btc { color: var(--btc-orange); }
.stat-borrowed { color: var(--green); }
.stat-interest { color: var(--yellow); }
.stat-debt { color: var(--red); }

.stat-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Status Badge ── */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-none {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}
.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 12px 4px var(--red-glow); }
}

/* ── Health Bar ── */
.health-section {
  margin-bottom: 20px;
}

.health-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.health-value {
  font-weight: 700;
  font-size: 1rem;
}

.health-bar-container {
  height: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.health-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease, background 0.5s ease;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.health-bar.warn {
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow-glow);
}

.health-bar.danger {
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
  animation: pulse-bar 1.5s infinite;
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.health-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.health-label-danger { color: var(--red); }
.health-label-warn { color: var(--yellow); }
.health-label-safe { color: var(--green); }

/* ── Deadline Timer ── */
.deadline-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.deadline-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.deadline-timer {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: 'Fira Code', monospace;
  color: var(--btc-orange);
  text-shadow: 0 0 12px var(--btc-orange-glow);
}

/* ── Position Actions ── */
.position-actions {
  display: flex;
  gap: 10px;
}

/* ── Protocol Stats ── */
.protocol-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.proto-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.proto-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.proto-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.proto-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.param {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.param-val {
  color: var(--btc-orange);
  font-weight: 600;
}

/* ── Form Sections ── */
.form-section {
  padding: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.form-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  transition: border-color var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--btc-orange);
  box-shadow: 0 0 0 3px var(--btc-orange-glow);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* ── Borrow Preview ── */
.borrow-preview {
  padding: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--btc-orange);
}

.borrow-preview h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.borrow-preview h3.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.preview-row span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Repay ── */
.repay-info {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.repay-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.repay-stat span:first-child {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.repay-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.repay-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* ── Liquidation ── */
.liq-list {
  margin-bottom: 24px;
}

.liq-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--red);
}

.liq-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.liq-item-addr {
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
  color: var(--text-primary);
}

.liq-item-debt {
  font-size: 0.8rem;
  color: var(--red);
}

.liq-item-btn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.liq-item-btn:hover {
  background: var(--red-dim);
}

.liq-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.liq-sim {
  padding: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.liq-sim h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sim-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sim-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.sim-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sim-val {
  font-weight: 700;
}

.sim-val.safe { color: var(--green); }
.sim-val.warn { color: var(--yellow); }
.sim-val.danger { color: var(--red); }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toast-success {
  background: var(--green-dim);
  border-left: 3px solid var(--green);
}
.toast-error {
  background: var(--red-dim);
  border-left: 3px solid var(--red);
}
.toast-info {
  background: #1e40af;
  border-left: 3px solid #3b82f6;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Mobile Responsive ── */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .nav-tabs {
    padding: 8px 16px;
  }

  .tab-content {
    padding: 16px;
  }

  .position-stats {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .repay-info {
    grid-template-columns: 1fr;
  }

  .sim-inputs {
    grid-template-columns: 1fr;
  }

  .position-actions {
    flex-direction: column;
  }

  .repay-actions {
    flex-direction: column;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Social Media Footer ── */
.social-footer {
  padding: 2rem 0;
  margin-top: 4rem;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.8) 0%, rgba(255, 140, 0, 0.9) 100%);
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.social-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

/* All buttons have same orange hover effect */
.social-btn:hover {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.9) 0%, rgba(255, 140, 0, 1) 100%);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.social-btn:hover .social-icon {
  filter: drop-shadow(0 4px 8px rgba(255, 165, 0, 0.6));
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .social-links {
    gap: 1.5rem;
  }
  
  .social-btn {
    width: 45px;
    height: 45px;
  }
  
  .social-icon {
    font-size: 1.3rem;
  }
}
