/* ══════════════════════════════════════════════════════════════════════════════
   🔗 ESTILOS PARA WALLET CONECTADA - RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════════════════════════ */

/* Contenedor principal de wallet conectada */
.wallet-connected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 50px;
    color: white;
    min-width: 200px;
    max-width: 280px;
    transition: all 0.2s ease;
}

.wallet-connected:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

/* Contenido principal de la wallet */
.wallet-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Permite que el contenido se contraiga */
}

/* Icono de la wallet */
.wallet-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Contenedor de la dirección */
.wallet-address {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0; /* Permite que el contenido se contraiga */
}

/* Indicador de wallet */
.wallet-indicator {
    color: #10b981;
    font-size: 12px;
    flex-shrink: 0;
}

/* Texto de la dirección */
.address-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón de desconexión */
.disconnect-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disconnect-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.disconnect-btn i {
    font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   📱 RESPONSIVE DESIGN - MÓVILES Y TABLETS
   ══════════════════════════════════════════════════════════════════════════════ */

/* Tablets medianos */
@media (max-width: 768px) {
    .wallet-connected {
        min-width: 180px;
        max-width: 220px;
        padding: 6px 14px;
    }
    
    .wallet-icon {
        width: 18px;
        height: 18px;
    }
    
    .address-text {
        font-size: 13px;
    }
    
    .wallet-indicator {
        font-size: 11px;
    }
}

/* Móviles grandes */
@media (max-width: 640px) {
    .wallet-connected {
        min-width: 160px;
        max-width: 200px;
        padding: 6px 12px;
        gap: 6px;
    }
    
    .wallet-content {
        gap: 6px;
    }
    
    .address-text {
        font-size: 12px;
    }
    
    .disconnect-btn {
        width: 24px;
        height: 24px;
        padding: 4px;
    }
    
    .disconnect-btn i {
        font-size: 11px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .wallet-connected {
        min-width: 140px;
        max-width: 170px;
        padding: 5px 10px;
    }
    
    .wallet-icon {
        width: 16px;
        height: 16px;
    }
    
    .address-text {
        font-size: 11px;
        max-width: 80px; /* Limitar ancho en pantallas muy pequeñas */
    }
    
    .wallet-indicator {
        font-size: 10px;
    }
    
    .disconnect-btn {
        width: 22px;
        height: 22px;
    }
    
    .disconnect-btn i {
        font-size: 10px;
    }
}

/* Pantallas extra pequeñas */
@media (max-width: 360px) {
    .wallet-connected {
        min-width: 120px;
        max-width: 150px;
        padding: 4px 8px;
    }
    
    .address-text {
        font-size: 10px;
        max-width: 70px;
    }
    
    /* En pantallas muy pequeñas, ocultar el icono indicator para ahorrar espacio */
    .wallet-indicator {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   🖥️ RESPONSIVE DESIGN - DESKTOP Y PANTALLAS GRANDES
   ══════════════════════════════════════════════════════════════════════════════ */

/* Desktop grande */
@media (min-width: 1200px) {
    .wallet-connected {
        min-width: 220px;
        max-width: 300px;
        padding: 10px 18px;
    }
    
    .address-text {
        font-size: 15px;
    }
    
    .wallet-icon {
        width: 22px;
        height: 22px;
    }
    
    .disconnect-btn {
        width: 30px;
        height: 30px;
    }
    
    .disconnect-btn i {
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   🎯 MEJORAS PARA DISPOSITIVOS TOUCH
   ══════════════════════════════════════════════════════════════════════════════ */

/* Mejoras para touch devices */
@media (hover: none) and (pointer: coarse) {
    .disconnect-btn {
        min-width: 44px; /* Área de toque mínima recomendada */
        min-height: 44px;
    }
    
    .wallet-connected:hover {
        background: rgba(34, 197, 94, 0.1); /* Desactivar hover en touch */
        border-color: rgba(34, 197, 94, 0.3);
    }
    
    .disconnect-btn:hover {
        color: rgba(255, 255, 255, 0.7); /* Desactivar hover en touch */
        background: none;
    }
    
    .disconnect-btn:active {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.1);
        transform: scale(0.95);
        transition-duration: 0.1s;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   🔧 OPTIMIZACIONES ESPECÍFICAS POR PLATAFORMA
   ══════════════════════════════════════════════════════════════════════════════ */

/* Optimizaciones para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .wallet-connected {
        -webkit-tap-highlight-color: transparent;
    }
    
    .disconnect-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

/* Optimizaciones para Android Chrome */
@media screen and (max-width: 768px) {
    .wallet-connected {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }
}

/* Mejoras de accesibilidad */
.wallet-connected:focus-within {
    outline: 2px solid rgba(34, 197, 94, 0.5);
    outline-offset: 2px;
}

.disconnect-btn:focus {
    outline: 2px solid rgba(239, 68, 68, 0.5);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   🌙 MODO OSCURO Y CONTRASTE ALTO
   ══════════════════════════════════════════════════════════════════════════════ */

/* Soporte para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    .wallet-connected {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.35);
    }
    
    .address-text {
        color: #f1f5f9;
    }
}

/* Soporte para contraste alto */
@media (prefers-contrast: high) {
    .wallet-connected {
        border-width: 2px;
        background: rgba(34, 197, 94, 0.2);
    }
    
    .address-text {
        color: #ffffff;
        font-weight: 600;
    }
    
    .disconnect-btn {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Estilos extraídos de unified-wallet.js para el modal y botones de wallet */
/* Variables CSS centralizadas en base.css */

/* Animaciones optimizadas */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    } 
    to { 
        opacity: 1; 
    } 
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
    } 
    to { 
        opacity: 0; 
    } 
}

@keyframes slideIn {
    from { 
        opacity: 0; 
    } 
    to { 
        opacity: 1; 
    } 
}

/* Animación pulse centralizada en base.css */

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
    } 
    to { 
        opacity: 1; 
    } 
}

.wallet-mobile-btn { 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); 
    border: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    transition: all 0.2s ease;
}

.wallet-mobile-btn.connected { 
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); 
}
.wallet-icon-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.wallet-mobile-btn.connected i { color: white; }

/* Botón de conexión desktop - Paleta BNBFund */

/* Botón de wallet conectada desktop - Paleta BNBFund */
.wallet-btn-status { display: flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 1px solid var(--gray-600); }
.status-text { color: var(--success-color); font-size: 13px; font-weight: 500; }
.wallet-btn-balance { display: flex; align-items: center; gap: 10px; }
.balance-info { display: flex; flex-direction: column; align-items: flex-start; }
.balance-amount { font-size: 14px; font-weight: 600; color: white; }
.balance-usd { font-size: 11px; color: var(--gray-400); }
.wallet-btn-address { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--gray-600); }
.wallet-btn-address i { color: var(--gray-400); font-size: 14px; }
.address-text { font-family: monospace; font-size: 13px; color: var(--gray-400); }

/* Modal backdrop */
.wallet-modal-backdrop.show { background: rgba(0, 0, 0, 0.75); opacity: 1; }

/* Modal de información de wallet */
.wallet-info-modal::-webkit-scrollbar { width: 0px; background: transparent; }
.wallet-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.modal-title { font-size: 22px; font-weight: 600; color: white; margin: 0; }
.wallet-modal-content { padding: 24px; }
.info-section:nth-child(1) { animation-delay: 0.1s; }
.info-section:nth-child(2) { animation-delay: 0.2s; }
.info-section:nth-child(3) { animation-delay: 0.3s; }
.info-box:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); }
.info-icon { color: var(--gray-400); font-size: 20px; }
.address-full { flex: 1; font-family: monospace; font-size: 15px; color: white; word-break: break-all; }
.copy-btn.copied { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.3); color: var(--success-color); }
.network-icon { width: 32px; height: 32px; }
.network-name { flex: 1; font-size: 16px; color: white; font-weight: 500; }

/* Balance card */
.balance-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.balance-labels { display: flex; flex-direction: column; }
.token-symbol { font-size: 20px; font-weight: 700; color: white; }
.token-name { font-size: 14px; color: var(--gray-400); }
.balance-values { display: flex; flex-direction: column; gap: 8px; }
.balance-main { font-size: 36px; font-weight: 700; color: white; line-height: 1; }
.balance-secondary { font-size: 18px; color: var(--gray-400); font-weight: 500; }
.exchange-rate { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; font-size: 14px; color: var(--gray-400); }
.exchange-rate i { color: #3b82f6; }
.wallet-modal-footer { padding: 24px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

/* Botón de wallet no registrada - Únete a BNBFund - Paleta BNBFund */
.wallet-register-button { 
    background: linear-gradient(135deg, #51277B 0%, #EB5FA6 100%); 
    border: 1px solid rgba(245, 191, 93, 0.3); 
    color: #FFFFFF; 
    padding: 8px 16px; 
    border-radius: 50px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    min-width: 280px; 
    position: relative; 
    overflow: hidden; 
}

.wallet-register-button:hover { 
    background: linear-gradient(135deg, #EB5FA6 0%, #F5BF5D 100%); 
    border-color: rgba(245, 191, 93, 0.5);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .wallet-info-modal { 
        max-width: calc(100vw - 40px); 
        margin: 0 auto; 
    }
    .modal-title { 
        font-size: 20px; 
    }
    .balance-main { 
        font-size: 28px; 
    }
    .balance-secondary { 
        font-size: 16px; 
    }
    .info-box { 
        padding: 14px; 
    }
    .address-full { 
        font-size: 13px; 
    }
    
    /* Optimizaciones adicionales para móvil */
    .wallet-mobile-btn {
        width: 48px;
        height: 48px;
        touch-action: manipulation;
    }
    
    .wallet-mobile-btn i {
        font-size: 22px;
    }
    
    .connect-wallet-btn {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
    }
    
    /* Mejorar el modal en móvil */
    .wallet-modal-content {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .wallet-modal-backdrop { 
        padding: 10px; 
    }
    .wallet-modal-header, 
    .wallet-modal-content, 
    .wallet-modal-footer { 
        padding: 20px; 
    }
    
    /* Mejoras específicas para pantallas muy pequeñas */
    .wallet-mobile-btn {
        width: 44px;
        height: 44px;
    }
    
    .wallet-mobile-btn i {
        font-size: 20px;
    }
    
    .connect-wallet-btn {
        padding: 12px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    .wallet-info-modal {
        max-width: calc(100vw - 20px);
        margin: 10px auto;
        max-height: calc(100vh - 40px);
    }
    
    .balance-main {
        font-size: 24px;
    }
    
    .balance-secondary {
        font-size: 14px;
    }
}

/* Mejoras para touch devices */
@media (hover: none) and (pointer: coarse) {
    .wallet-mobile-btn:active {
        transition-duration: 0.1s;
        transform: scale(0.95);
    }
    
    .connect-wallet-btn:active {
        transition-duration: 0.1s;
        transform: scale(0.98);
    }
}

/* Optimizaciones para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .wallet-modal-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Evitar zoom en inputs */
    .wallet-modal input {
        font-size: 16px;
    }
}

/* Mejoras para Android Chrome */
@media screen and (max-width: 768px) {
    .wallet-modal-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
    }
    
    /* Prevenir scroll del body cuando el modal está abierto */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Mejoras de accesibilidad en móvil */
@media (max-width: 768px) {
    .wallet-mobile-btn,
    .connect-wallet-btn {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }
    
    .wallet-mobile-btn:focus,
    .connect-wallet-btn:focus {
        outline: 2px solid rgba(245, 158, 11, 0.5);
        outline-offset: 2px;
    }
}
