/**
 * Unified Wallet Modal Styles
 * Similar to lookhu.fun interface
 */

/* Modal Overlay */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.wallet-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.wallet-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-modal-header h3 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.wallet-modal-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.wallet-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Modal Body */
.wallet-modal-body {
    padding: 25px 30px;
    max-height: 500px;
    overflow-y: auto;
}

.wallet-modal-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0 0 20px 0;
    font-weight: 500;
}

/* Wallet Grid */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .wallet-grid {
        grid-template-columns: 1fr;
    }
}

/* Wallet Option */
.wallet-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wallet-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(138, 88, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 88, 255, 0.2);
}

.wallet-option.installed {
    border-color: rgba(76, 175, 80, 0.3);
}

.wallet-option.not-installed {
    opacity: 0.6;
}

.wallet-option.not-installed:hover {
    opacity: 0.8;
}

/* Wallet Icon */
.wallet-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

/* Fallback for broken images */
.wallet-icon[src=""]:before,
.wallet-icon:not([src]):before {
    content: "💼";
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Wallet Name */
.wallet-name {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

/* Wallet Badge */
.wallet-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 152, 0, 0.9);
    color: #ffffff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Modal Footer */
.wallet-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

/* Toggle Switch */
.wallet-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.wallet-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.wallet-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #8a58ff;
}

.wallet-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

/* Loading State */
.wallet-option.connecting {
    pointer-events: none;
    opacity: 0.7;
}

.wallet-option.connecting::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #8a58ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
.wallet-modal-body::-webkit-scrollbar {
    width: 8px;
}

.wallet-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.wallet-modal-body::-webkit-scrollbar-thumb {
    background: rgba(138, 88, 255, 0.5);
    border-radius: 4px;
}

.wallet-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 88, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wallet-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .wallet-modal-header,
    .wallet-modal-body,
    .wallet-modal-footer {
        padding: 20px;
    }
    
    .wallet-modal-header h3 {
        font-size: 18px;
    }
    
    .wallet-icon {
        width: 40px;
        height: 40px;
    }
    
    .wallet-name {
        font-size: 14px;
    }
}

/* Dark Theme Adjustments */
@media (prefers-color-scheme: dark) {
    .wallet-modal-content {
        background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    }
}

/* Accessibility */
.wallet-option:focus {
    outline: 2px solid #8a58ff;
    outline-offset: 2px;
}

.wallet-modal-close:focus {
    outline: 2px solid #8a58ff;
    outline-offset: 2px;
}

