/* Estilos mejorados para campos de entrada de moneda con formateo automático */

.currency-input {
    text-align: right;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.currency-input:focus {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1), 0 4px 6px rgba(0, 0, 0, 0.07);
    outline: none;
    transform: translateY(-1px);
}

.currency-input.formatting {
    background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
    border-color: #38b2ac;
    animation: formatPulse 0.3s ease;
}

@keyframes formatPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.currency-input.is-invalid {
    border-color: #e53e3e;
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
    color: #c53030;
}

.currency-input.is-invalid:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1), 0 4px 6px rgba(0, 0, 0, 0.07);
}

.currency-input.is-valid {
    border-color: #38a169;
    background: linear-gradient(135deg, #c6f6d5 0%, #d4f1de 100%);
    color: #2f855a;
}

.currency-input.is-valid:focus {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1), 0 4px 6px rgba(0, 0, 0, 0.07);
}

.currency-group {
    position: relative;
    margin-bottom: 1rem;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a5568;
    font-weight: bold;
    font-size: 1.1em;
    pointer-events: none;
    z-index: 3;
    opacity: 0.7;
}

.currency-input.has-symbol {
    padding-left: 35px;
}

/* Tooltip mejorado para formato de moneda */
.currency-tooltip {
    position: absolute;
    bottom: -35px;
    left: 0;
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.currency-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 15px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2d3748;
}

.currency-input:focus+.currency-tooltip,
.currency-input:hover+.currency-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

/* Indicador visual de formateo en tiempo real */
.currency-input::placeholder {
    color: #a0aec0;
    font-style: italic;
    font-weight: 400;
}

/* Animación para cuando se aplica formateo automático */
.currency-input.auto-formatting {
    background: linear-gradient(135deg, #bee3f8 0%, #e6fffa 100%);
    transition: background 0.2s ease;
}

/* Indicador de validación mejorado */
.currency-validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    font-weight: bold;
    pointer-events: none;
    transition: all 0.3s ease;
    opacity: 0;
}

.currency-validation-icon.valid {
    color: #38a169;
    opacity: 1;
    animation: validPulse 0.5s ease;
}

.currency-validation-icon.invalid {
    color: #e53e3e;
    opacity: 1;
    animation: invalidShake 0.5s ease;
}

@keyframes validPulse {
    0% {
        transform: translateY(-50%) scale(0.8);
        opacity: 0;
    }

    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes invalidShake {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    25% {
        transform: translateY(-50%) translateX(-3px);
    }

    75% {
        transform: translateY(-50%) translateX(3px);
    }
}

/* Feedback visual para el usuario */
.currency-feedback {
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.3s ease;
}

.currency-feedback.show {
    opacity: 1;
}

.currency-feedback.success {
    background: #c6f6d5;
    color: #2f855a;
    border-left: 3px solid #38a169;
}

.currency-feedback.info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 3px solid #4299e1;
}

/* Estilos responsivos mejorados */
@media (max-width: 768px) {
    .currency-input {
        font-size: 1em;
        padding: 10px 12px;
    }

    .currency-tooltip {
        font-size: 0.75rem;
        bottom: -30px;
        padding: 6px 10px;
    }

    .currency-validation-icon {
        font-size: 1.1em;
        right: 12px;
    }
}

/* Tema oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .currency-input {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .currency-input:focus {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-color: #63b3ed;
    }

    .currency-tooltip {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
}

/* Animación de entrada suave */
.currency-input {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estado de carga */
.currency-input.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}
}