/* SatoshiFi User Wallet Styles */

/* Layout */
header {
    background: var(--satoshi-white);
    border-bottom: 1px solid var(--satoshi-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--satoshi-black);
    margin: 0;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--satoshi-dark-gray);
}

nav {
    display: flex;
    gap: 1rem;
}

nav a {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--satoshi-text);
    font-weight: 500;
    transition: all 0.2s;
}

nav a:hover {
    background: var(--satoshi-gray);
}

nav a.active {
    background: var(--satoshi-orange);
    color: var(--satoshi-white);
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--satoshi-light-gray);
    border-radius: 0.5rem;
}

.network-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.network-badge.mainnet {
    background: #28a745;
    color: white;
}

.network-badge.testnet {
    background: #ffc107;
    color: #333;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.card {
    background: var(--satoshi-white);
    border: 1px solid var(--satoshi-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Balance Card */
.balance-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.balance-display {
    margin: 1.5rem 0;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.balance-amount .amount {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.balance-amount .symbol {
    font-size: 1.5rem;
    opacity: 0.9;
}

.balance-usd {
    font-size: 1.125rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.action-card h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--satoshi-black);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--satoshi-text);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--satoshi-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--satoshi-orange);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
}

.hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--satoshi-dark-gray);
}

/* Buttons */
.btn-primary {
    background: var(--satoshi-orange);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #e07f00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(247, 147, 26, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--satoshi-gray);
    color: var(--satoshi-text);
    border: 1px solid var(--satoshi-border);
}

.btn-secondary:hover {
    background: var(--satoshi-medium-gray);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Transaction History */
.tx-history {
    max-height: 500px;
    overflow-y: auto;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tx-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--satoshi-light-gray);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tx-item:hover {
    background: var(--satoshi-gray);
    transform: translateX(4px);
}

.tx-item.received {
    border-left: 4px solid #28a745;
}

.tx-item.sent {
    border-left: 4px solid #dc3545;
}

.tx-icon {
    font-size: 1.5rem;
}

.tx-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tx-type {
    font-weight: 600;
    font-size: 0.875rem;
}

.tx-address {
    font-size: 0.75rem;
    color: var(--satoshi-dark-gray);
    font-family: 'Courier New', monospace;
}

.tx-amount {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.tx-amount.positive {
    color: #28a745;
}

.tx-amount.negative {
    color: #dc3545;
}

.tx-link {
    padding: 0.25rem 0.75rem;
    background: var(--satoshi-white);
    border: 1px solid var(--satoshi-border);
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--satoshi-text);
    font-size: 0.75rem;
}

.tx-link:hover {
    background: var(--satoshi-orange);
    color: white;
    border-color: var(--satoshi-orange);
}

/* Not Connected State */
.not-connected {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.not-connected .card {
    max-width: 500px;
    text-align: center;
}

.not-connected h2 {
    margin-bottom: 1rem;
    color: var(--satoshi-black);
}

.not-connected p {
    margin-bottom: 1.5rem;
    color: var(--satoshi-dark-gray);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--satoshi-dark-gray);
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--satoshi-dark-gray);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--satoshi-text);
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--satoshi-border);
    border-top-color: var(--satoshi-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--satoshi-text);
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

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

    .tx-item {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }

    .tx-amount {
        grid-column: 2;
        text-align: right;
    }

    .tx-link {
        grid-column: 1 / -1;
        text-align: center;
    }

    .balance-amount .amount {
        font-size: 2rem;
    }
}
