:root {
  --bg-dark: #0a0a0f;
  --bg-panel: #13131f;
  --bg-card: #1c1c2e;
  --primary: #00f3ff;
  --primary-dim: rgba(0, 243, 255, 0.1);
  --accent: #bc13fe;
  --text-main: #ffffff;
  --text-muted: #8b8b9b;
  --border: #2a2a35;
  --success: #00ff9d;
  --error: #ff0055;

  --font: "Outfit", sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: grid;
  grid-template-columns: 250px 1fr 300px; /* Sidebar | Main | Console */
  height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  letter-spacing: -0.5px;
}

.brand-dot {
  color: var(--primary);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1rem;
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 600;
}

.nav-item:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.user-status {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  padding: 2rem;
  overflow-y: auto;
  background: radial-gradient(
    circle at top right,
    #1c1c2e 0%,
    var(--bg-dark) 40%
  );
}

.view {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Auth View */
.auth-container {
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.tabs {
  display: flex;
  margin-bottom: 2rem;
  background: var(--bg-dark);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9rem;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

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

input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #000;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--primary-dim);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

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

.stat-card.full-width {
  grid-column: span 2;
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-card .sub {
  color: var(--primary);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.address-display {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  color: var(--text-muted);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

td:last-child {
  text-align: right;
  color: var(--text-muted);
  font-family: monospace;
}

/* Console */
.console-panel {
  background: black;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.85rem;
}

.console-header {
  padding: 1rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  background: #111;
}

.console-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  color: #0f0;
}

.log-entry {
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  white-space: pre-wrap;
  opacity: 0.8;
}

.log-entry.error {
  color: var(--error);
}
.log-entry.success {
  color: var(--success);
}
.log-entry.info {
  color: var(--text-muted);
}

/* Swap Specific */
.swap-interface {
  max-width: 500px;
  margin: 0 auto;
}

.swap-row {
  margin-bottom: 1.5rem;
}

.swap-row label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.input-with-token {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-token input {
  padding-right: 80px;
  font-size: 1.5rem;
}

.token-badge {
  position: absolute;
  right: 15px;
  background: var(--bg-panel);
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.token-badge.highlight {
  color: var(--accent);
  background: rgba(188, 19, 254, 0.1);
}

.swap-divider {
  text-align: center;
  margin: -10px 0 10px 0;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.balance-hint {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* New Swap Styles */
.swap-direction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: var(--bg-dark);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.2rem;
}

.btn-icon.circle {
  background: var(--bg-panel);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-icon.circle:hover {
  transform: rotate(180deg);
  border-color: var(--primary);
}

.fee-info-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.fee-row.total {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 0;
}
