/* ====================================
   ESTILOS PARA CONEXIÓN DE WALLET
   ==================================== */

/* Botón de wallet - Estado conectado */
.btn-wallet.wallet-connected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 1px solid #28a745;
    color: white;
    position: relative;
}

.btn-wallet.wallet-connected:hover {
    background: linear-gradient(135deg, #218838 0%, #1ab394 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Estado de carga */
.btn-wallet.loading {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: 1px solid #6c757d;
    position: relative;
    overflow: hidden;
}

.btn-wallet.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Menú desplegable de wallet */
.wallet-menu {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    z-index: 9999;
}

.wallet-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    color: #333;
}

.wallet-menu-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.wallet-menu-item.disconnect {
    border-top: 1px solid #e9ecef;
    margin-top: 4px;
    color: #dc3545;
}

.wallet-menu-item.disconnect:hover {
    background-color: #f8d7da;
    color: #dc3545;
}

.wallet-menu-item span {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Indicador visual de wallet conectada */
.btn-wallet.wallet-connected::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(40, 167, 69, 0.5);
}

/* Animación de pulso para el indicador */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.btn-wallet.wallet-connected::after {
    animation: pulse 2s infinite;
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .wallet-menu {
        right: 10px !important;
        left: auto !important;
        max-width: calc(100vw - 20px);
    }
    
    .btn-wallet.wallet-connected span {
        font-size: 12px;
    }
}

/* Tooltip para direcciones largas */
.wallet-address-tooltip {
    position: relative;
    cursor: pointer;
}

.wallet-address-tooltip:hover::after {
    content: attr(data-full-address);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    margin-bottom: 5px;
}

.wallet-address-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 10000;
}

/* Estados de error */
.btn-wallet.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 1px solid #dc3545;
    color: white;
}

.btn-wallet.error:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Animación de éxito cuando se conecta */
.btn-wallet.success {
    animation: success-flash 0.6s ease-in-out;
}

@keyframes success-flash {
    0% {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    }
    50% {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        color: #28a745;
        border-color: #28a745;
    }
    100% {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
    }
}

/* Mejoras visuales para el botón original */
.btn-wallet {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-wallet:active {
    transform: translateY(1px);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wallet-menu {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wallet-menu-item {
        color: #e2e8f0;
    }
    
    .wallet-menu-item:hover {
        background-color: #4a5568;
        color: #63b3ed;
    }
    
    .wallet-menu-item.disconnect {
        border-top-color: #4a5568;
        color: #fc8181;
    }
    
    .wallet-menu-item.disconnect:hover {
        background-color: #742a2a;
    }
}