:root {
    --primary-orange: #FF6B35;
    --secondary-orange: #FF8C42;
    --accent-orange: #FFB88C;
    --dark-text: #1A202C;
    --medium-text: #2D3748;
    --light-text: #718096;
    --bg-white: #FFFFFF;
    --bg-light: #F7FAFC;
    --bg-lighter: #EDF2F7;
    --success-green: #48BB78;
    --info-blue: #4299E1;
    --border-color: #E2E8F0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--dark-text);
    min-height: 100vh;
    font-size: 14px;
}

header {
    padding: 1rem 20px 1rem 10px;
}

.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    margin-top: 80px;
}

/* Compact Wallet Header */
.wallet-header {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: none;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.wallet-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.wallet-details h2 {
    font-size: 0.7rem;
    color: var(--light-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.wallet-address {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Monaco', monospace;
    color: var(--dark-text);
}

.wallet-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: var(--bg-light);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--medium-text);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success-green);
    border-radius: 50%;
}

.disconnect-btn {
    width: auto;
    background: var(--bg-white);
    color: var(--medium-text);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.disconnect-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

/* Compact Overview Cards */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.overview-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.overview-label {
    font-size: 0.7rem;
    color: var(--light-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.overview-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-text);
    margin-bottom: 0.3rem;
}

.overview-subtext {
    font-size: 0.75rem;
    color: var(--medium-text);
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Featured Purchase Box - HIGHLY VISIBLE */
.purchase-section-featured {
    position: relative;
    border: 1px solid var(--primary-orange) !important;
}

.purchase-section-featured .section-header {
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: white;
    position: relative;
    overflow: visible;
}

.purchase-section-featured .section-header::before {
    content: 'LIVE';
    position: absolute;
    top: 17px;
    right: 20px;
    background: #FF0000;
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.purchase-section-featured .section-icon {
    background: white !important;
    color: var(--primary-orange) !important;
}

.purchase-section-featured .section-title h2 {
    color: white;
}

/* Compact Section */
.dashboard-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.section-header {
    background: var(--bg-white);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    max-width: unset;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.section-title h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0;
    letter-spacing: 0;
}

.section-content {
    padding: 1.25rem;
}

/* Compact Balances - 2 Columns */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.balance-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.token-icon svg {
    width: 32px;
    height: 32px;
}

.token-info h3 {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

.token-info p {
    font-size: 0.7rem;
    color: var(--light-text);
    font-weight: 500;
}

.balance-right {
    text-align: right;
}

.balance-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-text);
}

.balance-usd {
    font-size: 0.75rem;
    color: var(--light-text);
}

/* Compact Purchase Section */
.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Payment Dropdown */
.payment-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-dropdown-btn:hover {
    border-color: var(--primary-orange);
}

.payment-dropdown-btn.active {
    border-color: var(--primary-orange);
}

.payment-option-display {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.payment-coin-icon {
    width: 28px;
    height: 28px;
}

.payment-coin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.payment-coin-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-text);
}

.payment-coin-balance {
    font-size: 0.7rem;
    color: var(--light-text);
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.payment-dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.payment-dropdown {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    min-width: 280px;
}

.payment-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.payment-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--bg-lighter);
    white-space: nowrap;
}

.payment-option:last-child {
    border-bottom: none;
}

.payment-option:hover {
    background: var(--bg-light);
}

.payment-option-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}

.payment-option-right {
    font-size: 0.8rem;
    color: var(--light-text);
    font-weight: 600;
    padding-left: 1rem;
}

.payment-selector {
    position: relative;
}

/* Restore overflow for proper border-radius clipping */
.dashboard-section {
    overflow: hidden;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

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

/* Amount + Buy Button Row */
.amount-buy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    align-items: stretch;
}

.amount-buy-row .form-input {
    min-width: 0;
}

/* Quick Buy Row - Payment + Amount + Button */
.quick-buy-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.6rem;
    align-items: stretch;
}

.payment-compact {
    padding: 0.8rem 1rem !important;
    min-width: 120px;
}

.payment-compact .payment-option-display {
    display: none;
}

.payment-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.payment-compact .payment-coin-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.payment-symbol {
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-compact {
    padding: 0.8rem 1.2rem !important;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Purchase Preview */
.purchase-preview {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    align-items: center;
}

.preview-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.preview-label {
    color: var(--light-text);
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-value {
    font-weight: 700;
    color: var(--dark-text);
    font-size: 0.85rem;
}

.preview-highlight {
    font-size: 1.3rem;
    color: var(--primary-orange);
    font-weight: 800;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--light-text);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before {
    display: none;
}

/* Transactions Table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead th {
    text-align: left;
    padding: 0.8rem;
    font-size: 0.7rem;
    color: var(--light-text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--bg-lighter);
}

.transactions-table tbody tr:hover {
    background: var(--bg-light);
}

.transactions-table tbody td {
    padding: 0.8rem;
    font-size: 0.85rem;
}

.tx-hash {
    font-family: 'Monaco', monospace;
    font-size: 0.8rem;
    color: var(--info-blue);
    text-decoration: none;
}

.tx-hash:hover {
    text-decoration: underline;
}

.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-green);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}

.empty-state svg {
    opacity: 0.2;
    margin-bottom: 0.8rem;
}

.empty-state h3 {
    color: var(--medium-text);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Spinner */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1400px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .balance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .wallet-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .wallet-info {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mobile: Stack Quick Buy elements vertically */
    .quick-buy-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .payment-compact {
        min-width: 100%;
    }

    /* Mobile: Dropdown takes full width */
    .payment-dropdown {
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .payment-option {
        padding: 0.9rem;
    }

    .payment-coin-info {
        font-size: 0.9rem;
    }

    .payment-coin-name {
        font-size: 0.85rem !important;
    }

    .payment-coin-balance {
        font-size: 0.7rem !important;
    }
}