/* ============================================
   WALLET DROPDOWN COMPONENT
   Modern glassmorphism design for Web3 wallet
   ============================================ */

:root {
    --tanda-cyan: #00FFFF;
    --tanda-cyan-light: #7FFFD8;
    --text-primary: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.7);
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: rgba(15, 23, 42, 0.8);
    --border-primary: rgba(148, 163, 184, 0.1);
    --border-accent: rgba(0, 255, 255, 0.2);
}

/* ============================================
   WALLET DROPDOWN PANEL
   ============================================ */

.wallet-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-height: 600px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ============================================
   WALLET HEADER
   ============================================ */

.wallet-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.wallet-address-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wallet-identicon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tanda-cyan), var(--tanda-cyan-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--bg-primary);
}

.wallet-address-info {
    flex: 1;
}

.wallet-address-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.wallet-address-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-address-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.wallet-copy-btn {
    background: transparent;
    border: none;
    color: var(--tanda-cyan);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-copy-btn:hover {
    background: rgba(0, 255, 255, 0.1);
}

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

.wallet-copy-btn i {
    font-size: 14px;
}

/* Copy success feedback */
.wallet-copy-btn.copied {
    color: #10b981;
}

/* ============================================
   NETWORK INDICATOR
   ============================================ */

.wallet-network {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    font-size: 13px;
}

.network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.network-dot.wrong-network {
    background: #ef4444;
}

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

.network-name {
    color: var(--text-primary);
    font-weight: 500;
}

.network-chain-id {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ============================================
   BALANCE SECTION
   ============================================ */

.wallet-balance {
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.05), rgba(0, 255, 255, 0.02));
    border-bottom: 1px solid var(--border-primary);
}

.balance-main {
    text-align: center;
    margin-bottom: 16px;
}

.balance-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 8px rgba(0, 255, 255, 0.3);
    margin-bottom: 4px;
}

.balance-token {
    font-size: 16px;
    color: var(--tanda-cyan);
    margin-left: 8px;
}

.balance-usd {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Balance breakdown */
.balance-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.balance-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.balance-item-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.balance-item-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-item-token {
    font-size: 12px;
    color: var(--tanda-cyan);
    margin-left: 4px;
}

/* ============================================
   RECENT TRANSACTIONS
   ============================================ */

.wallet-transactions {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}

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

.transactions-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-view-all {
    font-size: 12px;
    color: var(--tanda-cyan);
    text-decoration: none;
    transition: opacity 0.2s;
}

.transactions-view-all:hover {
    opacity: 0.8;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Custom scrollbar */
.transactions-list::-webkit-scrollbar {
    width: 4px;
}

.transactions-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: var(--tanda-cyan);
    border-radius: 2px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.transaction-item:hover {
    border-color: var(--border-accent);
    background: rgba(0, 255, 255, 0.05);
}

.transaction-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.transaction-icon.send {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.transaction-icon.receive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.transaction-icon.swap {
    background: rgba(0, 255, 255, 0.1);
    color: var(--tanda-cyan);
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.transaction-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.transaction-amount {
    text-align: right;
}

.transaction-value {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.transaction-value.positive {
    color: #10b981;
}

.transaction-value.negative {
    color: #ef4444;
}

.transaction-status {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-status.confirmed {
    color: #10b981;
}

.transaction-status.pending {
    color: #f59e0b;
}

/* Empty state */
.transactions-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

.transactions-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* ============================================
   QR CODE SECTION
   ============================================ */

.wallet-qr {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    display: none;
}

.wallet-qr.active {
    display: block;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-code {
    width: 200px;
    height: 200px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code canvas {
    width: 100% !important;
    height: 100% !important;
}

.qr-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   WALLET ACTIONS
   ============================================ */

.wallet-actions {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
}

.wallet-action-btn {
    flex: 1;
    padding: 8px 14px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    color: var(--tanda-cyan);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wallet-action-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    border-color: var(--tanda-cyan);
}

.wallet-action-btn:active {
    transform: scale(0.98);
}

.wallet-action-btn i {
    font-size: 14px;
}

.wallet-action-btn.disconnect {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.wallet-action-btn.disconnect:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .wallet-dropdown {
        position: fixed;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100vw;
        padding: 16px;
        box-sizing: border-box;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        transform: translateY(100%);
        margin: 0;
    }

    .wallet-dropdown.active {
        transform: translateY(0);
    }

    .balance-amount {
        font-size: 28px;
    }

    /* Ensure wallet content doesn't overflow */
    .wallet-content,
    .wallet-balance,
    .wallet-transactions {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

/* ============================================
   LOADING STATES
   ============================================ */

.wallet-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 13px;
}

.wallet-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-top-color: var(--tanda-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ERROR STATES
   ============================================ */

.wallet-error {
    padding: 20px;
    text-align: center;
    color: #ef4444;
    font-size: 13px;
}

.wallet-error i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.wallet-error-retry {
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-error-retry:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Make wallet button container relative for dropdown positioning */
.wallet-connect {
    position: relative !important;
}
