/* ===============================
   SELECTOR DE MONEDA OPTIMIZADO
   =============================== */
.currency-selector {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #68cef5;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 160px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.currency-selector:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(-3px);
    border-color: #5bc0de;
}

.currency-selector h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ===============================
   BOTONES DE MONEDA
   =============================== */
.currency-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.currency-btn {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 55px;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #495057;
}

.currency-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.currency-btn:hover {
    background: linear-gradient(145deg, #e9ecef, #dee2e6);
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.currency-btn:hover::before {
    left: 100%;
}

.currency-btn.active {
    background: linear-gradient(145deg, #68cef5, #5bc0de);
    color: white;
    border-color: #68cef5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(104, 206, 245, 0.4);
    font-weight: 700;
}

.currency-btn:active {
    transform: translateY(0) scale(0.95);
    transition: transform 0.1s;
}

.currency-btn.switching {
    animation: buttonSwitch 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===============================
   INDICADOR DE CARGA
   =============================== */
.loading-indicator {
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 8px;
}

.loading-indicator small {
    color: #6c757d;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-indicator small::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #68cef5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===============================
   ESTADOS DE PRECIOS OPTIMIZADOS
   =============================== */
.price-loading {
    opacity: 0.6;
    position: relative;
    pointer-events: none;
}

.price-loading .value {
    color: #6c757d;
    animation: pulse 1.5s ease-in-out infinite;
}

.price-changing {
    position: relative;
    transform: scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-changing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(104, 206, 245, 0.1), transparent);
    border-radius: 4px;
    animation: shimmer 0.8s ease-in-out;
    pointer-events: none;
}

.price-updated {
    animation: priceUpdateOptimized 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.price-error {
    color: #dc3545;
    font-size: 0.85em;
    font-weight: 500;
}

/* ===============================
   TRANSICIONES MEJORADAS
   =============================== */
.price-transition {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.price-highlight {
    position: relative;
    overflow: hidden;
}

.price-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(104, 206, 245, 0.3), transparent);
    animation: highlightSweep 1s ease-out;
}

.price-pulse {
    animation: gentlePulse 1.2s ease-in-out;
}

.price-slide-in {
    animation: slideInFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   EFECTOS PARA SÍMBOLOS Y VALORES
   =============================== */
.currency-symbol-change {
    display: inline-block;
    animation: symbolBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.value, .coin, .price, .price-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.price-container:hover .price-transition {
    transform: scale(1.01);
}

/* ===============================
   NOTIFICACIÓN DE ERROR
   =============================== */
.error-notification {
    animation: slideInFromTop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-notification button:hover {
    background: #f8f9fa !important;
    transform: scale(1.05);
}

/* ===============================
   ANIMACIONES KEYFRAMES
   =============================== */
@keyframes buttonSwitch {
    0% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
    100% { transform: translateY(-2px) scale(1); }
}

@keyframes priceUpdateOptimized {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    25% {
        transform: scale(1.05) rotateY(5deg);
        opacity: 0.8;
        color: #68cef5;
    }
    50% {
        transform: scale(1.08) rotateY(0deg);
        opacity: 0.9;
    }
    75% {
        transform: scale(1.02) rotateY(-2deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
        color: inherit;
    }
}

@keyframes shimmer {
    0% { left: -100%; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

@keyframes highlightSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(104, 206, 245, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(104, 206, 245, 0);
        transform: scale(1.01);
    }
}

@keyframes symbolBounce {
    0% { transform: scale(0.8) rotate(-5deg); opacity: 0.8; }
    50% { transform: scale(1.15) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(30px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 768px) {
    .currency-selector {
        bottom: 15px;
        left: 15px;
        padding: 12px;
        min-width: 140px;
    }

    .currency-selector h5 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .currency-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 48px;
    }

    .currency-buttons {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .currency-selector {
        bottom: 10px;
        left: 10px;
        padding: 10px;
        min-width: 120px;
    }

    .currency-selector h5 {
        font-size: 12px;
    }

    .currency-buttons {
        gap: 6px;
    }

    .currency-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 42px;
    }
}

@media (max-width: 320px) {
    .currency-selector {
        bottom: 5px;
        left: 5px;
        padding: 8px;
        min-width: 100px;
    }

    .currency-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 36px;
    }
}

/* ===============================
   MODO OSCURO (OPCIONAL)
   =============================== */
@media (prefers-color-scheme: dark) {
    .currency-selector {
        background: rgba(33, 37, 41, 0.95);
        border-color: #495057;
    }
    
    .currency-selector h5 {
        color: #e9ecef;
    }
    
    .currency-btn {
        background: linear-gradient(145deg, #495057, #343a40);
        color: #e9ecef;
        border-color: #6c757d;
    }
    
    .currency-btn:hover {
        background: linear-gradient(145deg, #6c757d, #495057);
    }
    
    .currency-btn.active {
        background: linear-gradient(145deg, #68cef5, #5bc0de);
        color: white;
    }
}

/* ===============================
   MEJORAS DE ACCESIBILIDAD
   =============================== */
.currency-btn:focus {
    outline: 2px solid #68cef5;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .currency-selector,
    .currency-btn,
    .price-transition,
    .value, .coin, .price, .price-content {
        transition: none;
    }
    
    .price-changing,
    .price-updated,
    .currency-symbol-change,
    .price-highlight,
    .price-pulse,
    .price-slide-in {
        animation: none;
    }
}
    