/* ============================================
   RATES.CSS
   Estilos del conversor y tarjetas de la vista Tasas.
   ============================================ */

/* Contenedor del conversor */
.converter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.converter-row label {
  font-weight: 500;
  color: var(--color-text);
  min-width: 80px;
}

.converter-row input,
.converter-row select {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 40px;
  padding: 10px 14px;
  font-size: 1rem;
  color: var(--color-text);
  outline: none;
  transition:
    border var(--transition),
    box-shadow var(--transition);
}

.converter-row input:focus,
.converter-row select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(255, 197, 214, 0.4);
}

/* Fila de tasa personalizada con animación de expansión */
#customRateRow {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease,
    margin 0.3s ease;
  margin-bottom: 0;
}

#customRateRow.active {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 12px;
}

/* Tarjeta de fecha */
.date-display {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.day-display {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 16px;
}

/* ========== HEADER DE CARD ========== */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header .card-title {
  margin-bottom: 0;
}

/* Animación de entrada para la vista */
.card {
  animation: fadeInUp 0.4s ease both;
}

#currencyIcon {
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== BOTÓN DE RECARGA (ICONO) ========== */
.btn-reload {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 40px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-text);
  transition: all var(--transition);
  font-size: 0.9rem;
  width: 100%;
  margin-top: 8px;
}
.btn-reload:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
}

.btn-reload i {
  font-size: 0.9rem;
}

/* ========== INDICADOR DE ESTADO ========== */
.status-live,
.status-offline,
.status-loading {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.status-live {
  background: var(--color-bg-success);
  color: var(--color-success);
}

.status-offline {
  background: var(--color-bg-error);
  color: var(--color-error);
}

.status-loading {
  background: var(--color-bg-warning);
  color: var(--color-warning);
}

/* ========== BOTÓN DE ACCIÓN (ICONO) ========== */
.btn-icon {
  background: none;
  border: 1px solid var(--color-border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition);
  font-size: 0.75rem;
}

.btn-icon:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ========== ANIMACIÓN SPIN ========== */
.btn-reload.spin i {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========== ANIMACIÓN STATUS ========== */
.status-animate {
  animation: fadeStatus 0.4s ease;
}

@keyframes fadeStatus {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
