/* ===== WALLET MODAL STYLES ===== */

/* Modal Overlay */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(25, 28, 31, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.wallet-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.wallet-modal-container {
    background: rgba(30, 33, 36, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.wallet-modal-overlay.active .wallet-modal-container {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.wallet-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.wallet-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    font-family: "Montserrat", sans-serif;
}

.wallet-modal-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-family: "Montserrat", sans-serif;
}

/* Close Button */
.wallet-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    padding: 0;
}

.wallet-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* Modal Body */
.wallet-modal-body {
    padding: 24px;
}

/* Wallet Options Grid */
.wallet-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Wallet Option Button */
.wallet-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    font-family: "Montserrat", sans-serif;
}

.wallet-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(254, 218, 3, 0.1), rgba(254, 218, 3, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wallet-option:hover {
    border-color: rgba(254, 218, 3, 0.4);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.wallet-option:hover::before {
    opacity: 1;
}

.wallet-option:active {
    transform: translateY(0);
}

/* Wallet Icon */
.wallet-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.wallet-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Wallet Name */
.wallet-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Recommended Badge */
.wallet-option.recommended::after {
    content: 'RECOMMENDED';
    position: absolute;
    top: 8px;
    right: -24px;
    background: linear-gradient(135deg, #feda03, #e3c305);
    color: #191c1f;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 24px;
    transform: rotate(45deg);
    letter-spacing: 0.5px;
}

/* Popular Badge */
.wallet-popular {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(254, 218, 3, 0.2);
    border: 1px solid rgba(254, 218, 3, 0.4);
    color: #feda03;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* WalletConnect Option (full width) */
.wallet-option.wallet-connect-option {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    background: rgba(254, 218, 3, 0.05);
    border-color: rgba(254, 218, 3, 0.2);
}

.wallet-option.wallet-connect-option:hover {
    background: rgba(254, 218, 3, 0.1);
}

.wallet-option.wallet-connect-option .wallet-icon {
    width: 40px;
    height: 40px;
}

.wallet-option.wallet-connect-option .wallet-name {
    font-size: 16px;
}

/* Loading State */
.wallet-option.loading {
    pointer-events: none;
    opacity: 0.6;
}

.wallet-option.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #feda03;
    border-radius: 50%;
    animation: wallet-spinner 0.6s linear infinite;
}

@keyframes wallet-spinner {
    to { transform: rotate(360deg); }
}

/* Error/Info Messages */
.wallet-modal-message {
    background: rgba(254, 218, 3, 0.1);
    border: 1px solid rgba(254, 218, 3, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #feda03;
    font-size: 13px;
    text-align: center;
    display: none;
    font-family: "Montserrat", sans-serif;
}

.wallet-modal-message.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
}

.wallet-modal-message.show {
    display: block;
}

/* Mobile Install Prompt */
.mobile-install-prompt {
    display: none;
    background: rgba(30, 33, 36, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-top: 16px;
}

.mobile-install-prompt.show {
    display: block;
}

.mobile-install-prompt h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
}

.install-buttons {
    display: flex;
    gap: 8px;
}

.install-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(254, 218, 3, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wallet-modal-container {
        max-width: 100%;
        width: calc(100% - 32px);
        margin: 16px;
    }

    .wallet-modal-header h2 {
        font-size: 20px;
    }

    .wallet-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wallet-option {
        padding: 18px 16px;
    }

    .wallet-option.wallet-connect-option {
        grid-column: 1;
    }

    .wallet-option.recommended::after {
        font-size: 9px;
        padding: 2px 20px;
        right: -20px;
    }
}

@media (max-width: 425px) {
    .wallet-modal-overlay {
        padding: 12px;
    }

    .wallet-modal-container {
        width: 100%;
        margin: 0;
    }

    .wallet-modal-header {
        padding: 20px 20px 12px;
    }

    .wallet-modal-body {
        padding: 20px;
    }

    .wallet-modal-header h2 {
        font-size: 18px;
    }

    .wallet-icon {
        width: 44px;
        height: 44px;
    }

    .wallet-name {
        font-size: 14px;
    }
}

/* Scrollbar Styling */
.wallet-modal-container::-webkit-scrollbar {
    width: 6px;
}

.wallet-modal-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.wallet-modal-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.wallet-modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Focus Styles for Accessibility */
.wallet-option:focus {
    outline: 2px solid rgba(254, 218, 3, 0.6);
    outline-offset: 2px;
}

.wallet-modal-close:focus {
    outline: 2px solid rgba(254, 218, 3, 0.6);
    outline-offset: 2px;
}

/* No-touch hover prevention on mobile */
@media (hover: none) {
    .wallet-option:hover {
        transform: none;
    }
}

/* Active/Touch States for Mobile */
@media (hover: none) {
    .wallet-option:active {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(254, 218, 3, 0.5);
    }
}
