/**
 * ServiKN Currency Converter Styles
 */

/* Selector de Moneda */
.servikn-currency-selector {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 1rem 0;
    text-align: center;
}

.currency-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.currency-option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid transparent;
}

.currency-option:hover {
    background: #f0f8ff;
}

.currency-option input[type="radio"] {
    margin: 0;
    width: auto;
}

.currency-option input[type="radio"]:checked + span {
    color: var(--primary, #0066cc);
}

.currency-option input[type="radio"]:checked {
    background: var(--primary, #0066cc);
    border-color: var(--primary, #0066cc);
}

.currency-option:has(input[type="radio"]:checked) {
    background: #f0f8ff;
    border-color: var(--primary, #0066cc);
}

.exchange-rate {
    color: #666;
    font-size: 0.9rem;
}

.exchange-rate small {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

/* Tasas de cambio múltiples */
.exchange-rates {
    margin-top: 1rem;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.rate-item {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}

.rate-item small {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* Precios Convertidos */
.servikn-price {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.servikn-price .price-eur {
    color: #16a34a;
    font-size: 1.1rem;
}

.servikn-price .price-bs {
    color: var(--primary, #0066cc);
    font-size: 1.1rem;
}

.exchange-info {
    margin-top: 0.3rem;
}

.exchange-info small {
    color: #666;
    font-size: 0.8rem;
    background: #f0f8ff;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

/* Widget de Tasas */
.servikn-widget-rates {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.servikn-widget-rates .rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.servikn-widget-rates .rate-item:last-child {
    border-bottom: none;
}

.servikn-widget-rates .currency {
    font-weight: 600;
    color: var(--text, #333);
}

.servikn-widget-rates .rate {
    font-weight: 700;
    color: var(--primary, #0066cc);
}

.rate-update {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.rate-update small {
    color: #666;
    font-size: 0.8rem;
}

/* Botón de Conversión */
.convert-price-btn {
    background: linear-gradient(135deg, var(--primary, #0066cc), var(--secondary, #00b4d8));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.convert-price-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.servikn-price .price-bs,
.servikn-price .price-eur {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .currency-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .currency-option {
        justify-content: center;
    }
    
    .servikn-widget-rates {
        padding: 1rem;
    }
    
    .servikn-widget-rates .rate-item {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
    }
}

/* Estilos para integración con páginas existentes */
.paquete-card .servikn-price {
    justify-content: center;
    margin: 1rem 0;
}

.precio .servikn-price {
    justify-content: center;
}

/* Indicador de carga */
.servikn-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary, #0066cc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estados de error */
.servikn-error {
    color: #dc2626;
    font-size: 0.9rem;
    background: #fef2f2;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin: 0.5rem 0;
}
