/* General Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #006ba1;
  --primary-light: rgba(0, 107, 161, 0.1);
  --secondary: #f0b90b;
  --accent: #00c6ff;
  --dark-bg: #0a0a0a;
  --card-bg: #111111;
  --surface: #1a1a1a;
  --border: #222222;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --success: #00d68f;
  --warning: #ffaa00;
  --danger: #ff3d71;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

/* DEGX Branded Header Styles */
.dashboard-header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  height: 80px;
  max-width: 1440px;
  margin: 0 auto;
}

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

.logo {
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.main-nav {
  display: flex;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 14px;
  position: relative;
}

.nav-item:hover,
.nav-item.active {
  background: var(--surface);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

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

.user-menu {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
      -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    color: #ffffff;
  border: 1px solid transparent;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  transform: translateY(-1px);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  transition: transform 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.1);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.profile-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 0;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  margin-top: 12px;
  backdrop-filter: blur(20px);
  animation: slideIn 0.3s ease-out;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}

.dropdown-item i {
  width: 18px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.dropdown-item:hover i {
  color: var(--primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
}

.mobile-nav-overlay.active {
  display: block;
}

.mobile-nav-content {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #000000;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 2001;
}

.mobile-nav-overlay.active .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.mobile-nav-header h2 {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
      -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.mobile-nav-close:hover {
  background: var(--surface);
  transform: rotate(90deg);
}

.mobile-nav {
  padding: 24px 0;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  font-weight: 600;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  transform: translateX(4px);
}

.mobile-nav-item i {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background: var(--primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.history-container {
    background: #000000;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease-out;
}

.history-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}

.back-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--secondary);
  font-size: 18px;
  margin-right: 16px;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.back-button:hover {
  background: var(--primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.history-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.swaps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.swap-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    background: #000000;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

.swap-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

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

.swap-pair {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.swap-pair i {
  color: var(--secondary);
  font-size: 16px;
}

.swap-status {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-completed {
  background: rgba(0, 214, 143, 0.1);
  color: var(--success);
}

.status-pending {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
}

.status-failed {
  background: rgba(255, 61, 113, 0.1);
  color: var(--danger);
}

.swap-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.swap-details {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: #000000;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease-out;
}

.swap-details.show {
  display: block;
}

.detail-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0;
  transition: background 0.3s ease;
}

.detail-row:hover {
  background: var(--primary-light);
}

.detail-label {
  width: 160px;
 background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
      -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    color: #ffffff;
  font-weight: 500;
  font-size: 14px;
}

.detail-value {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
}

.tx-hash {
  font-family: monospace;
  word-break: break-all;
  color: var(--primary);
  transition: color 0.3s ease;
}

.tx-hash:hover {
  color: var(--secondary);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.pagination button.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-primary);
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.5s ease-out;
}

.empty-state i {
  font-size: 48px;
  color: var(--secondary);
}

.empty-state p {
  font-size: 16px;
}

.loading {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 16px;
  animation: pulse 1.5s infinite;
}

.copy-icon {
  margin-left: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.3s ease;
}

.copy-icon:hover {
  color: var(--secondary);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
}

.modal-content h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.modal-content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-content button {
  padding: 10px 20px;
  margin: 0 8px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.modal-content button:hover {
  transform: scale(1.05);
}

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

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

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

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

@media (max-width: 768px) {
  .header-main {
    padding: 0 24px;
    height: 70px;
  }

  .main-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block;
  }

  .user-name {
    display: none;
  }

  .profile-dropdown-menu {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 90%;
    max-width: 300px;
  }

  .container {
    padding: 16px;
  }

  .history-container {
    padding: 16px;
  }

  .detail-label {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .header-main {
    padding: 0 16px;
  }

  .logo {
    font-size: 24px;
  }

  .mobile-nav-content {
    width: 280px;
  }

  .swap-pair {
    font-size: 16px;
  }

  .swap-status {
    font-size: 10px;
  }
}