/* Path: online-web/src/jsMain/resources/wallet.css */

/**
 * Wallet Connection Component Styles
 *
 * Styling for ConnectWalletButton and wallet-related UI elements.
 * Supports both normal and compact layouts.
 *
 * @version 1.0.0
 * @date 2025-11-25
 */

/* ============================================================================
   WALLET BUTTON CONTAINER
   ============================================================================ */

.wallet-button-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.wallet-button-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.wallet-button-container-compact {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

/* ============================================================================
   WALLET STATUS CARD
   ============================================================================ */

.wallet-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.wallet-status-card.wallet-status-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
    border-color: #4caf50;
}

.wallet-status-card.wallet-status-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
    border-color: #f44336;
}

.wallet-status-card.wallet-status-loading {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border-color: #2196f3;
}

.wallet-status-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.wallet-status-text {
    flex: 1;
}

.wallet-status-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.wallet-status-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.wallet-address-display {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #2196f3;
    font-weight: 600;
    background: rgba(33, 150, 243, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

/* ============================================================================
   WALLET CONNECTED BADGE (COMPACT)
   ============================================================================ */

.wallet-connected-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
    border: 1px solid #4caf50;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.wallet-connected-icon {
    font-size: 16px;
    line-height: 1;
}

.wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #2196f3;
    font-weight: 600;
}

.disconnect-button-small {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.disconnect-button-small:hover {
    background: #d32f2f;
}

/* ============================================================================
   WALLET ERROR BADGE (COMPACT)
   ============================================================================ */

.wallet-error-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
    border: 1px solid #f44336;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.error-icon {
    font-size: 16px;
    line-height: 1;
}

.error-text {
    font-size: 13px;
    color: #f44336;
    font-weight: 600;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

.wallet-status-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: wallet-spin 0.8s linear infinite;
}

.button-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: wallet-spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* ============================================================================
   BUTTON ICONS
   ============================================================================ */

.button-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

.button-text {
    vertical-align: middle;
}

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

@media (max-width: 600px) {
    .wallet-button-container {
        padding: 16px;
        gap: 12px;
    }

    .wallet-status-card {
        padding: 12px;
        gap: 12px;
    }

    .wallet-status-icon {
        font-size: 24px;
    }

    .wallet-status-text strong {
        font-size: 14px;
    }

    .wallet-status-text p {
        font-size: 12px;
    }

    .wallet-address-display {
        font-size: 11px;
    }

    .wallet-connected-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .wallet-address {
        font-size: 11px;
    }
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .wallet-button-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-color: #444;
    }

    .wallet-status-card {
        background: #2d2d2d;
        border-color: #444;
    }

    .wallet-status-card.wallet-status-success {
        background: linear-gradient(135deg, #1b5e20 0%, #2d2d2d 100%);
        border-color: #4caf50;
    }

    .wallet-status-card.wallet-status-error {
        background: linear-gradient(135deg, #b71c1c 0%, #2d2d2d 100%);
        border-color: #f44336;
    }

    .wallet-status-card.wallet-status-loading {
        background: linear-gradient(135deg, #0d47a1 0%, #2d2d2d 100%);
        border-color: #2196f3;
    }

    .wallet-status-text strong {
        color: #e0e0e0;
    }

    .wallet-status-text p {
        color: #b0b0b0;
    }

    .wallet-connected-badge {
        background: linear-gradient(135deg, #1b5e20 0%, #2d2d2d 100%);
    }

    .wallet-error-badge {
        background: linear-gradient(135deg, #b71c1c 0%, #2d2d2d 100%);
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.wallet-button-container button:focus,
.disconnect-button-small:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.wallet-status-text p {
    line-height: 1.5;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .wallet-button-container {
        border-width: 3px;
    }

    .wallet-status-card {
        border-width: 2px;
    }

    .wallet-connected-badge,
    .wallet-error-badge {
        border-width: 2px;
    }
}
