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

: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);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.fa-solid, .fas {
    font-weight: 900;
    color: #888888;
}

/* 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;
}

.swap-container {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

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

.swap-header h1 {
    font-size: 22px;
    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;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 150px;
}

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

.swap-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.swap-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swap-input-group label {
    font-weight: 500;
    color: #888888;
    font-size: 14px;
}

.input-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: #000000;
    transition: all 0.3s ease;
}

.input-wrapper:hover {
    border-color: var(--primary);
}

.input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 18px;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 0;
}

.input-wrapper input:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.currency-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.currency-select-wrapper {
    position: relative;
}

.selected-currency {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.selected-currency:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.currency-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
}

.selected-currency span {
    font-weight: 600;
    font-size: 14px;
    color: #888888;
}

.hidden-select {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.currency-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.balance-label {
    font-weight: 500;
}

.balance-amount {
    font-family: monospace;
    font-weight: 600;
}

.btn-max {
    background: #000000;
    border: 1px solid #222222;
    color: #006ba1;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.swap-arrow {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.swap-arrow button {
    background: #000000;
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #222222;
}

.swap-arrow button:hover {
    background: #000000;
    transform: rotate(180deg) scale(1.1);
}

.swap-details {
    margin: 24px 0;
    padding: 16px;
    background: #000000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item span:first-child {
    font-weight: 500;
}

.detail-item span:last-child {
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-primary:disabled {
    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;
    cursor: not-allowed;
    border: 1px solid #222222;
}

.btn-secondary {
    padding: 10px 20px;
    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 #222222;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    
}



.btn-secondary:hover {
    /* background: #222222; */
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #000000;
    margin: 5% auto;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

.currency-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-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: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary);
}

.search-container {
    margin-bottom: 16px;
}

#currencySearch {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #000000;
    color: var(--text-primary);
    font-size: 14px;
}

#currencySearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.currency-list {
    max-height: 300px;
    overflow-y: auto;
    color: #888888;
}

.currency-option {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border);
}

.currency-option:hover {
    background: var(--primary-light);
}

.currency-option img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
}

.currency-option span {
    font-weight: 500;
    font-size: 14px;
}

#historyTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

#historyTable th,
#historyTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#historyTable th {
    font-weight: 600;
    color: var(--primary);
    background: var(--surface);
}

#historyTable td:first-child,
#historyTable td:nth-child(2) {
    display: flex;
    align-items: center;
}

#historyTable .currency-logo {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 50%;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

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

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

.pagination button:disabled {
    background: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
}

#pageInfo {
    color: var(--text-secondary);
    font-size: 14px;
}

.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
    min-width: 300px;
    max-width: 350px;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease-in-out forwards;
    font-size: 14px;
    line-height: 1.5;
}

.notification-toast.success {
    background: #000000;
    border-left: 4px solid var(--success);
    color: var(--text-primary);
}

.notification-toast.error {
    background: #000000;
    border-left: 4px solid var(--danger);
    color: var(--text-primary);
    border: 1px solid #222222;
}

.notification-toast.warning {
    background: #000000;
    border-left: 4px solid var(--warning);
    color: var(--text-primary);
    
}

.notification-toast .toast-icon {
    margin-right: 12px;
    font-size: 18px;
}

.notification-toast .toast-content {
    flex: 1;
}

.notification-toast .toast-close {
    margin-left: 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 16px;
    transition: opacity 0.3s ease;
}

.notification-toast .toast-close:hover {
    opacity: 0.7;
}

.notification-toast .toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-toast .toast-message {
    opacity: 0.9;
}

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

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

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

.status-completed {
    color: var(--success);
    font-weight: 600;
}

.status-failed {
    color: var(--danger);
    font-weight: 600;
}

.status-pending {
    color: var(--warning);
    font-weight: 600;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@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;
    }

    .swap-container {
        max-width: 100%;
    }

    .swap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    #historyTable th,
    #historyTable td {
        padding: 8px;
        font-size: 12px;
    }

    .notification-toast {
        min-width: 250px;
        max-width: 90vw;
        top: 10px;
        right: 10px;
    }
}

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

    .logo {
        font-size: 24px;
    }

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

    .swap-header h1 {
        font-size: 24px;
    }

   .swap-card {
    padding: 16px;
    width: 390px;
}

    .input-wrapper input {
        font-size: 16px;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #222222;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.mobile-menu-btn:hover {
    background: #006ba1;
    color: #ffffff;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-main {
        padding: 0 20px;
        height: 70px;
    }

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

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .user-name {
        display: none;
    }

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


/* === MOBILE-FIRST MARKET TABLE: Show all columns at a glance === */
@media (max-width: 768px) {
  /* Remove horizontal scroll container padding issues */
  .market-table-container {
    overflow-x: hidden;
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* Disable traditional table layout on mobile */
  .market-table {
    min-width: auto !important;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .market-table thead {
    display: none;
  }

  .market-table tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .market-table tr:last-child {
    border-bottom: none;
  }

  .market-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 0 !important;
    font-size: 13px;
    font-weight: 500;
    flex: 1 1 22%; /* Ensures 4 columns fit */
    min-width: 0;
    gap: 4px;
  }

  /* Add visual labels with icons */
  .market-table td:nth-child(1)::before { content: "🪙 Asset"; }
  .market-table td:nth-child(2)::before { content: "💰 Price"; }
  .market-table td:nth-child(3)::before { content: "📈 24h Change"; }
  .market-table td:nth-child(4)::before { content: "⚡ Action"; }

  .market-table td::before {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* Ensure Action button stays visible and tappable */
  .market-table td:last-child {
    flex-shrink: 0;
    align-items: center;
    margin-left: 8px;
  }

  .market-table td:last-child .btn,
  .market-table td:last-child a,
  .market-table td:last-child button {
    font-size: 12px;
    padding: 6px 10px;
    min-width: 60px;
    text-align: center;
    border-radius: 8px;
    background: var(--primary);
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .market-table td:last-child .btn:hover,
  .market-table td:last-child a:hover,
  .market-table td:last-child button:hover {
    background: var(--primary-dark, #005a87);
    transform: translateY(-1px);
  }
}